Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > DEVELOPMENT > Hacks and Modifications

Post Reply
 
Thread Tools
  #1  
Old 03-09-2005, 01:57 PM
Rob Offline
pixelpost guru
 
Join Date: Mar 2005
Location: Burlington, Canada
Posts: 342
Send a message via ICQ to Rob Send a message via MSN to Rob
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;
Next you need to add a header.html and footer.html to your template directory. These files should contain HTML that is common to the start and end of every page on your site. You then need to edit every other HTML template for your site and remove the HTML at the start and end of these pages that you have added to your new templates.

Hope this helps people.
__________________
shifted*exposure powered by PixelPost 1.4
Reply With Quote
  #2  
Old 03-27-2005, 09:14 AM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
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?
Reply With Quote
  #3  
Old 07-06-2005, 07:15 AM
tanjatiziana Offline
pp regular
 
Join Date: Apr 2005
Location: Toronto, Canada
Posts: 42
Send a message via MSN to tanjatiziana Send a message via Yahoo to tanjatiziana
Is there a way to prevent/remove the header & footer from the comments pop-up?? Any help would be much appreciated.
Reply With Quote
  #4  
Old 09-16-2005, 05:51 PM
Nemesis Offline
pp veteran
 
Join Date: Sep 2005
Posts: 52
Send a message via AIM to Nemesis Send a message via MSN to Nemesis
Has this been resolved?
There is no point having header and footer in pop up window.
Reply With Quote
  #5  
Old 09-17-2005, 05:52 PM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
yes! there is a way - as i use this option. umm... if i remember rightly:

move the following in index.php:

PHP Code:
if($_GET['popup'] == "comment")
{
    
$tpl file_get_contents("templates/".$cfgrow['template']."/comment_template.html");

below the following:

PHP Code:
// Added ability to use header and footers for templates.  They are not needed but used if included in the template
$tpl $header $tpl $footer
this should be around line 150. basically you're just excludign the comment_template from the header/footer rule.
Reply With Quote
  #6  
Old 09-18-2005, 03:59 PM
Nemesis Offline
pp veteran
 
Join Date: Sep 2005
Posts: 52
Send a message via AIM to Nemesis Send a message via MSN to Nemesis
OH ok thanks
I was trying to remove comment_template from this thinking it was defined elsewere as well.
Reply With Quote
  #7  
Old 10-03-2005, 04:19 AM
fotogram's Avatar
fotogram Offline
pp veteran
 
Join Date: May 2005
Location: Walnut Creek, CA
Posts: 92
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
__________________
Guilherme Pinto
http://www.fotogram.com
Reply With Quote
  #8  
Old 10-03-2005, 02:47 PM
Joe[y]'s Avatar
Joe[y]+ Offline
Team Pixelpost
 
Join Date: Mar 2005
Location: UK
Posts: 3,101
Send a message via MSN to Joe[y]
Quote:
Originally Posted by fotogram
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
this is a problem with one possible solution:

like i showed for the comment_template do the same for image_template to exclude it from the headers rule.
Reply With Quote
  #9  
Old 10-05-2005, 04:20 AM
fotogram's Avatar
fotogram Offline
pp veteran
 
Join Date: May 2005
Location: Walnut Creek, CA
Posts: 92
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 &amp; 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;
}
__________________
Guilherme Pinto
http://www.fotogram.com
Reply With Quote
  #10  
Old 08-18-2006, 05:35 PM
Noxdineen Offline
forum loafer
 
Join Date: Aug 2006
Posts: 2
Thank you, this is perfect.
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 01:00 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs