Jump to content


Photo

PHP Template System.. HELP ! ! ! !


  • Please log in to reply
14 replies to this topic

#1 Pbkilldezines

Pbkilldezines

    Young Padawan

  • Members
  • Pip
  • 31 posts

Posted 28 September 2004 - 03:17 PM

Ok I want my tutorial to pull up the rest of my site with it.. For example- when you clikc the link to go to one of my tutorials (Tutorial Link) It only brings up the tutorial/ Not my website interface? Is there any way to make it so that it loads in my sites IFRAME insted of makeing a new page for every sungle tutorial?

#2 Dabu

Dabu

    Young Padawan

  • Members
  • Pip
  • 148 posts
  • Location:Greensboro, North Carolina

Posted 28 September 2004 - 03:46 PM

You have to use query strings or include header/footer files. I have a tutorial on query strings on my website http://www.dabu4u.com so I do not feel the need to explain it. If you want a direct linkt ot he tutorial it is

http://www.dabu4u.co...hp/querystrings

#3 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 28 September 2004 - 04:34 PM

you could do what i did and switch from html to php include()'s

symply type:
if ($id) { include('$id'); } else { include('file.php'); }

change 'file.php' to the file you want to show up when ppl go to pbkill.com and set your links to be
<a href="file.php?id=tutorial">

changing file to the same thing as before, and tutorial the name of the file you want to include w/o the extention (i.e. neonmen, not neonmen.html)

p.s. you have to save your index file as .php not .html (index being what ever has your template)

working example of the codes above in my sig (just click the link)

#4 Gio

Gio

    Jedi In Training

  • Members
  • PipPip
  • 317 posts

Posted 28 September 2004 - 05:07 PM

Seems the question was answered well before I could even get in my reply.

#5 Pbkilldezines

Pbkilldezines

    Young Padawan

  • Members
  • Pip
  • 31 posts

Posted 28 September 2004 - 07:03 PM

Rc69 i dont think you guys really understand what im saying.... When i submit my tutorials to a site like good-tutorials.com , the tutorial goes right to the page without my layout becasue from my layout would load it in a IFRAME. SOOO what i want to do is have it so when you clikc the link from good-tutorials it brings me to the tutorial but also loads my layout.

Rc89 could you please alaberate a little more please?

#6 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 28 September 2004 - 08:04 PM

ok... since you didn't understand ill say it again...

<a href="file.php?id=tutorial">


for the link you submit to good tutorials make it

http://www.yourdomain.com/index.php?id=tutorial


#7 Pbkilldezines

Pbkilldezines

    Young Padawan

  • Members
  • Pip
  • 31 posts

Posted 28 September 2004 - 08:10 PM

if ($id) { include('$id'); } else { include('file.php'); }


what do i do with this tho... i know that other part for the links? do i put this in my index.php or my navigation.php file?

#8 Pbkilldezines

Pbkilldezines

    Young Padawan

  • Members
  • Pip
  • 31 posts

Posted 28 September 2004 - 09:07 PM

Ok ive got it all figueard out... but is there anyway to do this so that i can make them change inside an iframe so it dosent screw up my layout when the tutorial is to long to fit within the main content box?

#9 Blitz

Blitz

    Jedi In Training

  • Twodded Staff
  • PipPip
  • 307 posts
  • Location:California
  • Interests:Php, html, css, etc, band, trumpet, anime, my dog, TV, computers, video games, sleeping, marching band, sleeping, jazz, sleeping, metal, sleeping, classic rock, sleeping, music, jazz band, did I mention sleeping?, kicking the hell out of kids that won't take the time to spell or use proper grammar, my website, etc.

Posted 28 September 2004 - 11:45 PM

Well, for my content on my site I had this inside the <td> for my content box which makes a scroll bar. Put this where your iframe was. This'll make it so much easier.

<div style="overflow:auto; width:yourwidthherepx; height:yourheightherepx"><?php 
if(!issetid)){
include("yourfilehere.php");
}
else {
include("id.php";
}
?>
</div>

That made the scroll bars. And the px at the end of the width and height has to be there. So it would be 67px as an example for either of them. $id can be substituted for whatever you want. And the !isset part of the if statement is for the main page, without any arguments in the url. So like http://urlhere.com/index.php?id=page1 would make your layout with page.php1 in the content box. Simple.

#10 Unreal

Unreal

    like.. TOTally cool!

  • Members
  • Pip
  • 241 posts

Posted 29 September 2004 - 01:50 PM

I dont think php is needed, itts a iframe that you wont it in? well change the link to the tutorial so that
target=iframe

that way it will load insided the iframe, if you called your iframe something other then iframe make it target=what ever you caled it

#11 Blitz

Blitz

    Jedi In Training

  • Twodded Staff
  • PipPip
  • 307 posts
  • Location:California
  • Interests:Php, html, css, etc, band, trumpet, anime, my dog, TV, computers, video games, sleeping, marching band, sleeping, jazz, sleeping, metal, sleeping, classic rock, sleeping, music, jazz band, did I mention sleeping?, kicking the hell out of kids that won't take the time to spell or use proper grammar, my website, etc.

Posted 29 September 2004 - 08:30 PM

Yeah, but when you go to that individual page, it won't have the layout around it which is what he wants.

#12 Unreal

Unreal

    like.. TOTally cool!

  • Members
  • Pip
  • 241 posts

Posted 30 September 2004 - 12:47 PM

well yeah, but people that use the link in his site would

#13 rc69

rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 30 September 2004 - 05:19 PM

in his site it might work, but not an offsite like like good tutorials...

best thing that comes to my mind is php, and i don't think that the code blitz gave would exactly work

<div style="overflow:auto; width:yourwidthherepx; height:yourheightherepx"><?php 
if(isset(id)){
include("id.php");
}
else {
include("yourfilehere.php");
}
?>
</div>

i switched it around a little bit to be more like the original code i gave, plus added a ( after isset, so it would be isset() not issetid)
as for the <div> code, i remember seing something like that, it should work, but all i did on my site was make a central table made-to-stretch, that way i didn't have to worry about iframes, but you did give me an idea for a place where i did have to use an iframe, thanks :)

#14 Pbkilldezines

Pbkilldezines

    Young Padawan

  • Members
  • Pip
  • 31 posts

Posted 30 September 2004 - 05:34 PM

is there any way to use google ads with this?

#15 Blitz

Blitz

    Jedi In Training

  • Twodded Staff
  • PipPip
  • 307 posts
  • Location:California
  • Interests:Php, html, css, etc, band, trumpet, anime, my dog, TV, computers, video games, sleeping, marching band, sleeping, jazz, sleeping, metal, sleeping, classic rock, sleeping, music, jazz band, did I mention sleeping?, kicking the hell out of kids that won't take the time to spell or use proper grammar, my website, etc.

Posted 30 September 2004 - 06:55 PM

in his site it might work, but not an offsite like like good tutorials...

best thing that comes to my mind is php, and i don't think that the code blitz gave would exactly work

<div style="overflow:auto; width:yourwidthherepx; height:yourheightherepx"><?php 
if(isset(id)){
include("id.php");
}
else {
include("yourfilehere.php");
}
?>
</div>

i switched it around a little bit to be more like the original code i gave, plus added a ( after isset, so it would be isset() not issetid)
as for the <div> code, i remember seing something like that, it should work, but all i did on my site was make a central table made-to-stretch, that way i didn't have to worry about iframes, but you did give me an idea for a place where i did have to use an iframe, thanks :)

Woops, missed that. That's what I mean. I'll just post my actual code:

<div style="width:336px; height:545px; overflow:auto"><? 
 	 if (!isset($id)){
 	 include("news.php");
 	 }
 	 else{
 	 include("$id.php");
 	 }
 	 ?>
 	 </div>

That's what I did.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users