No announcement yet.

1 Layout, $PutInBody, Folder.. Support

  • Filter
  • Time
  • Show
Clear All
new posts

  • Dan615
    I wrote so that you could throw everything into one template. Here's my best shot at what I think you mean:

    PHP Code:

    "templates/standard.txt";    // the template which everything gets thrown in to
    $url = (isset($_GET['url']) ? $_GET['url'] : "index.php");    // loads the index page by default

    // load the template file
    $template_fp = @fopen($template_file"r") or die("Couldn't open $template_file");
    $template fread($template_fpfilesize($template_file));

    // load the requested url
    $page_fp = @fopen($url"r") or die("Couldn't open $url");
    $page fread($page_fpfilesize($url));

    // escape the quotes in the template
    $template str_replace("\"""\\\""$template);

    // echo the template with the page put in
    eval("echo \"$template\";");

    Somewhere in the template would be the $page variable, and that's where the content from index.php would come from. You would call this page like pagename.php?'s way different then that source code you gave us, but whatever

    vB took out some back slashes where they should have eval("echo "$template\";"); should have a backslash in front of the quote before $template, and there should be three backslashed in the second argument of str_replace

    P.S. I didn't test it
    Last edited by Dan615; Mon 12 Aug '02, 9:50am.

    Leave a comment:

  • f00kj00
    That’s a pretty confusing situation……. If your problem is the eval code doesn’t work try chaning
    PHP Code:
     eval("echo stripslashes(\"$a_main\");"); 
    PHP Code:
     eval(‘echo stripslashes("$a_main");'); 
    I'm feeling pretty rusty but you don't want that var parsed in the eval statement... Also maybe you don't want that stripslashes in the string... So also try this

    PHP Code:
     eval(‘echo '.stripslashes('"$a_main"')'); 

    Leave a comment:

  • camarosource
    started a topic 1 Layout, $PutInBody, Folder.. Support

    1 Layout, $PutInBody, Folder.. Support

    My site is catagorized within folders

    ie. /root

    etc.. To help organize it.

    I have seen the following done on other sites (with php) but don't know how they did it.

    1 layout html page. When you click links, the pages load in a specific region of layout. Friend did Main.php which allows the page to be pasted where $PutInBody is. It also reads the url after "?URL=" and attaches to it so it's a working link.

    I don't know .php and the guy who did main.php did it a year ago and has not replied to any of my emails.
    I don't need his coding in there that fixes the image paths anymore. His code also is causing PHP in main_orig.php (the layout page that main.php loads) to NOT parse php in main_orig.php. According to IRC #PHP the "eval fuction" is causing this? or something.. So I need someone to re-write/edit the script so it WILL do what I need it to do, parse php, the code in main_orig.php, paste pages when clicked in the $PutInBody area, & be able to use links that are NOT all in root.. (catagorized within many folders)

    What is the best way of being able to have 1 layout html file for the entire site. Then when a link is clicked that page loads in a specific area of layout. I don't want any FRAMES, IFRAMES nor SSI.. is the main.php script renamed to .phps so you can view it.

    Is anyone here willing enough to write the script that will run the site?

    Thank you so very much for your time and I hope someone here is friendly enough to help more than the people on IRC php channels (Call you LAME, or just say "READ THE MANUAL"). For someone who doesn't need to know all about php as he only need it for 1 small purpose, doesn't have the time to read out a manual on php.. just wish people would remmeber the time they were looking for assistance and wished they could find someone who would help them.. And remember what it was like when all they got was "READ THE MANUAL" support. Do onto others as you would have do onto you. :-) Thanks again.

Related Topics