|
#1
|
|||
|
|||
|
Page Headers and Footers
I have the same header (site header and links) and footer (copyright and link buttons) on every page on my site and hate having to keep them in sync between each of the template pages. To make maintaining my site easier, I have modified pixelpost to include a header and a footer on every page. Warning, you will need some HTML knowledge to do this 8)
First, edit index.php and modify the fetch template code near the top like the following. It is the first two lines and the last line that are added. Code:
// read the template file
$header = file_get_contents("templates/".$cfgrow['template']."/header.html");
$footer = file_get_contents("templates/".$cfgrow['template']."/footer.html");
switch ($_GET['x']) {
case "ref":
$tpl = file_get_contents("templates/".$cfgrow['template']."/referer_template.html");
break;
case "browse":
$tpl = file_get_contents("templates/".$cfgrow['template']."/browse_template.html");
break;
case "":
default:
$tpl = file_get_contents("templates/".$cfgrow['template']."/image_template.html");
break;
}
if($_GET['popup'] == "comment") {
$tpl = file_get_contents("templates/".$cfgrow['template']."/comment_template.html");
}
$tpl = $header . $tpl . $footer;
Hope this helps people. |
|
#2
|
||||
|
||||
|
thank you. the way you have structured this seems to show that the header and footer files will be included in the comment page as well... am i right?
|
|
#3
|
|||
|
|||
|
Is there a way to prevent/remove the header & footer from the comments pop-up?? Any help would be much appreciated.
|
|
#4
|
|||
|
|||
|
Has this been resolved?
There is no point having header and footer in pop up window. |
|
#5
|
||||
|
||||
|
yes! there is a way - as i use this option. umm... if i remember rightly:
move the following in index.php: PHP Code:
PHP Code:
__________________
Affordable Website Design in North Wales |
|
#6
|
|||
|
|||
|
OH ok thanks
![]() I was trying to remove comment_template from this thinking it was defined elsewere as well. |
|
#7
|
||||
|
||||
|
That's a cool hack, but...
I use the image name on the <title>, which helps me distinguish which image has been viewed on my stats package (Mint). How can I make sure the <IMAGE_NAME> is only added to the <title> if the image_template has been loaded. I tried adding some <? php ?> in the template itself but that did not work. Right now all my non image tamplate pages load with a title of "fotogram :: <IMAGE_TITLE>" TIA |
|
#8
|
||||
|
||||
|
Quote:
like i showed for the comment_template do the same for image_template to exclude it from the headers rule.
__________________
Affordable Website Design in North Wales |
|
#9
|
||||
|
||||
|
Here is how I solved my problem:
Code:
switch ($_GET['x']) {
case "ref":
$tpl = file_get_contents("templates/".$cfgrow['template']."/referer_template.html");
break;
case "browse":
$tpl = file_get_contents("templates/".$cfgrow['template']."/browse_template.html");
$header = str_replace("<title><SITE_TITLE> :: <IMAGE_TITLE></title>","<title><SITE_TITLE> :: Archive</title>",$header);
break;
case "links":
$tpl = file_get_contents("templates/".$cfgrow['template']."/links_template.html");
$header = str_replace("<title><SITE_TITLE> :: <IMAGE_TITLE></title>","<title><SITE_TITLE> :: Links & About</title>",$header);
break;
case "contact":
$tpl = file_get_contents("templates/".$cfgrow['template']."/contact_template.html");
$header = str_replace("<title><SITE_TITLE> :: <IMAGE_TITLE></title>","<title><SITE_TITLE> :: Contact</title>",$header);
break;
case "thankyou":
$tpl = file_get_contents("templates/".$cfgrow['template']."/thankyou_template.html");
$header = str_replace("<title><SITE_TITLE> :: <IMAGE_TITLE></title>","<title><SITE_TITLE> :: Thank You</title>",$header);
break;
case "":
default:
$tpl = file_get_contents("templates/".$cfgrow['template']."/image_template.html");
break;
}
|
|
#10
|
|||
|
|||
|
Thank you, this is perfect.
|
| Post Reply |
| Thread Tools | |
|
|