Including Content Help

Started by Trikip July 12th, 2005 5:45 PM
  • 764 views
  • 12 replies

Trikip

Can you Handel this?

Age 28
Male
USA
Seen June 10th, 2016
Posted January 21st, 2011
1,643 posts
18.4 Years
I have just gotten a new layout, so I decided to start including content now, instead of including the layout. I have read a few tutorials, but I just don't undrstand it. Could someone explain it a little clearer, or set it up for me? Thanks.

EDIT: Oops meant to post this in General...or does it go here?
"I should be sorry if I only entertained them, I wish to make them better." -George Frideric Handel

Rukario

Banned

Somewhere in Ilex Forest
Seen April 6th, 2019
Posted March 17th, 2019
7,587 posts
20.7 Years
your layout acts as a shell or wrapper around your content.. so you format your content to how you want it to display and include it into your layout or index page. you can use either php or ssi (.shtml) to do so.

if you need help with the include codes, we'll need to know what system you plan to use.

Trikip

Can you Handel this?

Age 28
Male
USA
Seen June 10th, 2016
Posted January 21st, 2011
1,643 posts
18.4 Years
do you mean php includes?
Yes, I do. I have been including the layout, but I decided to start icluding the content instead. I just need some help.
"I should be sorry if I only entertained them, I wish to make them better." -George Frideric Handel
Age 31
Michigan
Seen September 18th, 2006
Posted August 18th, 2006
2,775 posts
19.6 Years

<?
if(isset($_GET['id']))
{
$id=$_GET['id'];
// include php
if(is_file($id ".php"))
{
include 
$id ".php";
}
else
{
// include html
if(is_file($id ".html"))
{
include 
$id ".html";
}
// your 404 text
else echo "404 - Page/File Not Found.";
}
}
// your default filefile
else include "show_news.php";
?>
That code goes in your layout (which needs to be index.php), where your content should go. The only thing you need to change is the second to last line with "else include" on it. That will be the page that shows up when you just type in index.php. Just put your news page in there.

Now all your other content needs to be .php from now on and should not have the SSI includes on them. Then to display those you would have index.php?id=pagelocation without the .php. You can also have folders like index.php?id=folder/pagelocation . If you have any questions just ask. ^^

Trikip

Can you Handel this?

Age 28
Male
USA
Seen June 10th, 2016
Posted January 21st, 2011
1,643 posts
18.4 Years
When I make a new page, I go to the page to see if it worked, but the layout just turns up all messed up and the content doesn't appear. Could someone just set it up for me? I don't mean set up all the pages, just one page to show me how to do it.
"I should be sorry if I only entertained them, I wish to make them better." -George Frideric Handel
Age 33
Forport City
Seen October 9th, 2005
Posted September 15th, 2005
21 posts
18 Years
Trikip this is what you do, in your pages right now like say http://pokejunction.jkaizer.net/index.php, you should have something like <? include php ("layoutpage.php") ?> and then under that <div style="z-index: 1; left: -470px; width: 450px; position: absolute; top: -55px; height: 132px;" id="layer1" align="left"><font face="Arial"><font color="#FFFFFF" face="Geneva, Arial, Sans-serif" size="1"> well what you need to do is copy the code that you have on your index pages, and all other pages that is similar to <div style="z-index: 1; left: -470px; width: 450px; position: absolute; top: -55px; height: 132px;" id="layer1" align="left"><font face="Arial"><font color="#FFFFFF" face="Geneva, Arial, Sans-serif" size="1"> and put it on your index page under that paste the code that pichusecretbase posted, and if you need any other help go on AIM and I will help or just PM me.
I'm FULL of crime :bandit:
Age 31
Michigan
Seen September 18th, 2006
Posted August 18th, 2006
2,775 posts
19.6 Years
Before putting in your PHP code then, copy a page of content and put it there. Once the content looks right replace teh content with the code. The code goes right where the content goes.

The url brings teh content into the layout id=pagename so it'd be index.php?id=pagename