Different header for each album?

Herodes

Joined: 2004-01-26
Posts: 1
Posted: Mon, 2004-01-26 22:45

Hello everybody,

First i want to express my thanks to the developpers of Gallery, after trying a lot of different programs to create online photo-albums i finally found Gallery, and i just love it! Keep up the good work!

Ok, so let´s go on to my question: is it possible to insert a different header for each album? I design specific headers that fit the content of the album, but all i can do so far is a universal header for all albums. If anyone knows how to solve my problem, i wouls very much appreciate it. Thanx in advance!

Regards, Herodes

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2004-01-27 03:11

One way to do that is in html_wrap/album.header (copy from album.header.default if you haven't already).. you could add something like:

<?php global $GALLERY_BASEDIR;
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
    include($albumheader);
} else { ?>
/* default album header goes here... */
<?php } ?>

This will look for a file called {albumname}.header in the html_wrap directory and include it if found.. otherwise it will use a default header.. by album "name" I mean the name you see the URL; for album01 you would create html_wrap/album01.header for its header.

 
YadMon

Joined: 2004-02-07
Posts: 2
Posted: Sat, 2004-02-07 20:24

Sorry, I tried to follow the explantion Mindless wrote, but I must have missed something 'cause it didn't work. Here 's my code of the the <AlbumName>.header file. Note that when I use the <AlbumName>.header name (in my case zadik.header), nothing happens... there's no header at all, as though the deafaultheader is in affect. When I rename the file to album.header it takes control on all the albums!!

My code is:


?>
<?php
includeHtmlWrap("wrapper.header");
?>

<table width=100% border=0>
  <tr>
    <td>
      <span class="head">
        <?php echo $gallery->album->fields["title"] ?>
      </span>
    </td>
  </tr>
  <tr>
    <td valign="top">

<p align="center">
<img border="0" src="http://www.zadik.nomda.net/images/candle_header_logoen.jpg" width="700" height="100"></p>
<p align="center"><strong><a href="http://zadik.nomda.net/candles_en.php">
<font color="#e4e4e4">Light A Candle In Their Memory</font></a></strong><font color="#E4E4E4">
| </font><a href="http://nomda.net/gallery/zadik"><strong><font color="#e4e4e4">
Photo Album</font></strong></a><font color="#E4E4E4"> | <b>
<a target="_blank" href="http://zadik.nomda.net/uploader/">
<font color="#E4E4E4">Upload Pics</font></a></b> | </font>
<a href="http://zadik.nomda.net/news.htm"><strong><font color="#e4e4e4">N</font></strong><font color="#e4e4e4"><strong>ews
From US & Israel</strong></font></a><font color="#E4E4E4"> | </font>
<a href="http://zadik.nomda.net/"><strong><font color="#e4e4e4">Home</font></strong></a><font color="#E4E4E4">
</font></p>

Please advise, referring specifacly to where I should make the changes to make it work only on the zadik album.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2004-02-09 04:32

You need album.header and zadik.header. Copy album.header.default to album.header and make the changes I described above.. keep the zadik.header file you have above.

 
YadMon

Joined: 2004-02-07
Posts: 2
Posted: Mon, 2004-02-09 10:49

10Q!

 
bodie8
bodie8's picture

Joined: 2004-02-10
Posts: 12
Posted: Tue, 2004-02-10 16:22

I am also trying to include a different header for each album. I have included the code posted by mindless in my album.header file (copied from album.header.default), and creaded a new file called Niya.header. 'Niya" is the {albumtitle} for the album.

When I view the album page, I get the following error:

"Parse error: parse error in /var/www/html/gallery/html_wrap/album.header on line 30"

Here are the lines (with line numbers added) in my album.header file is:

[code]
27 <?php global $GALLERY_BASEDIR;
28 $albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
29 if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
30     include($albumheader);
31 } else { ?>
32 /* default album header goes here... */
33 <?php } ?>
[/code/}

I have tried this with a few other albums as well, with the same results.

Any suggestions?
Thanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2004-02-11 06:00

Not sure what you've got before line 27 or after line 33, but you should have something in place of my comment for line 32. Let me be more specific about the contents of album.header:
1) copy album.header.default to album.header
2) insert the text you have listed as lines 27-31 in album.header just after this:

<?php
includeHtmlWrap("wrapper.header");
?>

3) Add the text you have listed as line 33 at the bottom of the file.

 
bodie8
bodie8's picture

Joined: 2004-02-10
Posts: 12
Posted: Wed, 2004-02-11 08:11

Thanks for the quick response.

> you should have something in place of my comment for line 32.
I assumed the comment was ok, but I have since taken it out.

> 1) copy album.header.default to album.header
Yep, did that.

> 2) insert the text you have listed as lines 27-31 in album.header just after this:
Did that too.

> 3) Add the text you have listed as line 33 at the bottom of the file.
Ah, I had misread your comment. So, this
<?php } ?>
goes at the very end of the file, after the HTML table?

Like so?...

<?php
includeHtmlWrap("wrapper.header");
?>


<?php
includeHtmlWrap("wrapper.header");
?>


<?php global $GALLERY_BASEDIR;
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
    include($albumheader);
} else { ?>


<table width="100%" border="0">
  <tr>
    <td>
      <table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
        <tr valign="middle">
          <td class="leftspacer"></td>
          <td>
            <table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
              <tr>
                <td class="mod_toplight_left" align="right"></td>
                <td nowrap class="head" align="left">
        &<?php echo $gallery->album->fields["title"] ?>&
                </td>
                <td class="mod_toplight_right" align="left">
                </td>
              </tr>
            </table>
          </td>
       </tr>
     </table>
     <table width="100%" cellpadding="0" cellspacing="0">
       <tr>
         <td class="mod_under_hl"></td>
       </tr>
     </table>
    </td>
  </tr>
  <tr>
    <td valign="top">
   

<?php } ?>

That's what I have now, and I still get a parse error that points to this line:

include($albumheader); 

PHP is completely new to me, but looking at this, I think I get the basic concept, and I am excited to get it to work. I'm sure it's just a simple thing that is a little bit off.

thanks again.

 
hehafner
hehafner's picture

Joined: 2004-01-05
Posts: 11
Posted: Wed, 2004-02-11 08:25

Could this code also help with embedding different music into different slideshows?

For instance, I need wedding music to go with a wedding slideshow and kiddie music to go with the kids' slideshow...

Thanks...
Heidi Hafner

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2004-02-19 03:31

bodie8, other than including wrapper.header twice at the top the code looks ok to me.. I don't see what's causing the error. Perhaps you can post your album.header as an attachment or post the url of your gallery and I can take a look..

hehafner, yes, you could use a similar technique to include any code in different albums.. I'm not familiar with adding music on a page, but if you put the correct html in the {albumname}.header files it could work..

 
bodie8
bodie8's picture

Joined: 2004-02-10
Posts: 12
Posted: Fri, 2004-02-20 07:15

> other than including wrapper.header twice at the top
(that was just an accident in the post, not actually in my album.header)

I'm not sure what the problem was, but it disappeared when I removed extra character spaces from:

<?php global $GALLERY_BASEDIR;
   $albumheader = $GALLERY_BASEDIR . '/html_wrap/' .
   $gallery->album->fields["name"] . '.header';
   if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
   include($albumheader);
   } else { ?>

I didn't see anything obviously wrong, no odd hidden characters, and BBEdit is usually pretty good about revealing that sort of thing.

Anyway, I just deleted all character spaces that separated each line, and even replaced them with my own, and it worked fine. Must have been some hidden gremlins from my original copy/paste of the code in the first place.

Works great now! Thanks!

 
leslienord

Joined: 2003-09-08
Posts: 75
Posted: Sat, 2004-05-01 14:05

This one has got me beat. I'm getting:
Parse error: parse error in /home/sites/site96/html/Gallery/html_wrap/album.header on line 18

17 <?php
18 includeHtmlWrap("wrapper.header");
19 ?>
20
21
22<?php global $GALLERY_BASEDIR;
23$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->24fields["name"] . '.header';
25if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
26† † include($albumheader);
27} else { ?>

(I've left the rest of the line numbers out)

<table width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
<tr valign="middle">
<td class="leftspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
<tr>
<td class="mod_toplight_left" align="right"></td>
<td nowrap class="head" align="left">
&amp;<?php echo $gallery->album->fields["title"] ?>&amp;
</td>
<td class="mod_toplight_right" align="left">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="mod_under_hl"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<?php } ?>

I'm just not sure what can be wrong here. I have the other {albumname}.header in place but it looks like I'm not even getting past the default.

Thanks,
Leslie

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2004-05-01 18:40

leslienord,
Try removing the two empty lines 20 and 21. Then look at line 26 you have a t and t

Then if that does not work post your code as a text attachment and we'll see what is the trouble is.

In the future you can use the Code tags in the forum it makes it easy to see things as the white space is not stripped.

Dave

 
leslienord

Joined: 2003-09-08
Posts: 75
Posted: Sat, 2004-05-01 21:21

Spaces! Not the ones at lines 20 & 21 but the t and t were actually spaces that as soon as I removed them - Voila! Two sucesses in one day - I feel very blessed.

THANK YOU!

Leslie

 
Lerosia
Lerosia's picture

Joined: 2003-08-03
Posts: 11
Posted: Sun, 2004-06-20 18:34
mindless wrote:
One way to do that is in html_wrap/album.header (copy from album.header.default if you haven't already).. you could add something like:

<?php global $GALLERY_BASEDIR;
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
    include($albumheader);
} else { ?>
/* default album header goes here... */
<?php } ?>

This will look for a file called {albumname}.header in the html_wrap directory and include it if found.. otherwise it will use a default header.. by album "name" I mean the name you see the URL; for album01 you would create html_wrap/album01.header for its header.

Hi

I read through this whole thread and attempted to apply this mod to no avail--I just get a blank header but it might the CSS file overriding it?
Heres all the info

Our gallery http://www.anwc.org/gallery/

I am using the white skin, I have a custom header on the albums page(thanks for the tutorial) and have customized the css file
----------------------------------------------------------------------------
Heres the CSS for the gallery headers (now this jpg is on all myalbums)
-----------------------------------------------------------------------

.head /* page headers behind the Gallery title*/
{

background-image: url(../images/weddingsgall2.jpg);
line-height:140%;
letter-spacing: .2em;
border:0px dashed #999999;
width: 452px;
height: 65px;
}

------------------------------------------------------------------------

Heres my album.header code (as done per your suggestion)
----------------------------------------------------------------------
<?php
// This is the default album header (for the gallery
// page: view_album.php). It's companion is album.footer.default.
//
// To override this header, create a file called album.header
// in this directory.
//
// NOTE: This header gets inserted below the <body> tag.
//
// Some tips:
// * Some application variables:
// - Gallery Title: $gallery->app->galleryTitle
// - Album Title: $gallery->album->fields["title"]
//
// $Id: album.header.default,v 1.16 2003/10/20 02:20:23 john_kirkland Exp $
?>
<?php
includeHtmlWrap("wrapper.header");
?>

<?php global $GALLERY_BASEDIR;
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
include($albumheader);
} else { ?>

<table width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
<tr valign="middle">
<td class="leftspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
<tr>
<td class="mod_toplight_left" align="right"></td>
<td nowrap class="head" align="left">
&amp;<?php echo $gallery->album->fields["title"] ?>&amp;
</td>
<td class="mod_toplight_right" align="left">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="mod_under_hl"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<?php } ?>

-----------------------------------------------------------------------------
Heres my weddings.header code (the header i want on the weddings page)
-----------------------------------------------------------------------------

?>
<?php
includeHtmlWrap("wrapper.header");
?>

<table width=100% border=0>
<tr>
<td>
<span class="head">
<?php echo $gallery->album->fields["title"] ?>
</span>
</td>
</tr>
<tr>
<td valign="top">

<p> <p align="center"> <img border="0" src="http://www.anwc.org/images/weddingsgall.jpg" width="452" height="65"></p>
<p align="center"><a href="mailto:anwclub@covad.net"><font color="#DF0024" size="1" face="Verdana">Send
E-mail</font></a><font color="#DF0024" size="1" face="Verdana"> | </font>
<font color="#DF0024" size="1" face="Verdana"><a href="http://www.anwc.org/home.html">ANWC
Home </a></font>
&amp;</p></td>

-------------------------------------------------------------------------

Now for this to work do I need to get rid of the header in the CSS code?

(by the way..the image i have currently in the css code 'weddingsgall2.jpg' is not the one i want at the top of the that weddings gallery..its weddingsgall.jpg--i just created a new one so all the albums wouldnt have a wedding title)

Or am I missing some code somewhere in the headers?

Thanks in advance

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2004-06-20 20:07

Your album.header looks fine from what I can tell.
Your wedding.header does not. First it has a ?> at the top. That is not required.
Next it should have the same format as the ORIGINAL album.header with the opening table cell at the bottom. The original album.header had:
<tr>
<td valign="top">
at the bottom to start the rest of the Gallery page. There might be more wrong as I did not look in detail. But you should be able to make a copy of the original album.header and call it wedding.header and add some test text to see if it works.

As for the css. If you have a image for the body in the css it will show on all pages.

Dave

 
Lerosia
Lerosia's picture

Joined: 2003-08-03
Posts: 11
Posted: Sun, 2004-06-20 21:25
floridave wrote:
Your album.header looks fine from what I can tell.
Your wedding.header does not. First it has a ?> at the top. That is not required.
Next it should have the same format as the ORIGINAL album.header with the opening table cell at the bottom. The original album.header had:
<tr>
<td valign="top">
at the bottom to start the rest of the Gallery page. There might be more wrong as I did not look in detail. But you should be able to make a copy of the original album.header and call it wedding.header and add some test text to see if it works.

As for the css. If you have a image for the body in the css it will show on all pages.

Dave

Ahhhh! thank you!

Thats what I didnt get..that the wedding head had to be exactly same except for the ..etc

Got it

Thanks for your help fellow Canuck

 
garyferrer

Joined: 2004-02-24
Posts: 8
Posted: Sun, 2004-07-04 03:45

I've gone over this post several times and find it far to vague for me to do this. I have no idea for example if I need code in each album directory. Can someone help clarify this process (I'm unfamiliar with php though).

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2004-07-05 22:17

garyferrer,
If you want a custom header for a particular album this is the steps you need to do:

Take this code and save it as album.header

<?php
// This is the default album header (for the gallery
// page: view_album.php). It's companion is album.footer.default.
//
// To override this header, create a file called album.header
// in this directory. 
// 
// NOTE: This header gets inserted below the <body> tag.
// 
// Some tips:
// * Some application variables:
//      - Gallery Title: $gallery->app->galleryTitle    
//      - Album Title: $gallery->album->fields["title"]    
//      
// $Id: album.header.default,v 1.16 2003/10/20 02:20:23 john_kirkland Exp $
?>
<?php global $GALLERY_BASEDIR; 
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header'; 
if (fs_file_exists($albumheader) && !broken_link($albumheader)) { 
    include($albumheader); 
} else { ?>
<?php
includeHtmlWrap("wrapper.header");
?>

<table width="100%" border="0">
  <tr>
    <td>
      <table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
        <tr valign="middle">
          <td class="leftspacer"></td>
          <td>
            <table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
              <tr>
                <td class="mod_toplight_left" align="right"></td>
                <td nowrap class="head" align="left">
		  &amp;<?php echo $gallery->album->fields["title"] ?>&amp;
                </td>
                <td class="mod_toplight_right" align="left">
                </td>
              </tr>
            </table>
          </td>
       </tr>
     </table>
     <table width="100%" cellpadding="0" cellspacing="0">
       <tr>
         <td class="mod_under_hl"></td>
       </tr>
     </table>
    </td>
  </tr>
  <tr>
    <td valign="top">
	<?php } ?>

then take this code and save it as album01.header

<?php
// This is the default album header (for the gallery
// page: view_album.php). It's companion is album.footer.default.
//
// To override this header, create a file called album.header
// in this directory. 
// 
// NOTE: This header gets inserted below the <body> tag.
// 
// Some tips:
// * Some application variables:
//      - Gallery Title: $gallery->app->galleryTitle    
//      - Album Title: $gallery->album->fields["title"]    
//      
// $Id: album.header.default,v 1.16 2003/10/20 02:20:23 john_kirkland Exp $
?>
<?php
includeHtmlWrap("wrapper.header");
?>

<table width="100%" border="0">
  <tr>
    <td>
      <table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
        <tr valign="middle">
          <td class="leftspacer"></td>
          <td>
            <table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
              <tr>
                <td class="mod_toplight_left" align="right"></td>
                <td nowrap class="head" align="left">
		  &amp;<?php echo $gallery->album->fields["title"] ?>&amp;
                </td>
                <td class="mod_toplight_right" align="left">
                </td>
              </tr>
            </table>
          </td>
       </tr>
     </table>
     <table width="100%" cellpadding="0" cellspacing="0">
       <tr>
         <td class="mod_under_hl">this is the custom album01 header</td>
       </tr>
     </table>
    </td>
  </tr>
  <tr>
    <td valign="top">

Edit to your desires.

Now if you want another album other than album01, (with a custom header) then you have to make another copy of the second file and call it albumname.header. Gallery will look for a header file and if not found it will give the default header. All these files are in the html_wrap directory. No code required in the album directory.

Dave

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2004-08-06 03:36
 
MBaas

Joined: 2004-08-07
Posts: 3
Posted: Sat, 2004-08-07 06:49

Hi,

I have a small variation of the issue: I have already done a customization of the footer, but now I want that customization to be used on all pages BUT those of one album and all its subalbums. In that album users are allowed to add their own albums, so I cannot hardcode specific names of the subalbums, I would have to somehow use the 'base-album'. Is there a way to do this?

Tx

Michael

 
MBaas

Joined: 2004-08-07
Posts: 3
Posted: Sat, 2004-08-07 13:28

Well, here's what I did:

  • applied a naming convention for the album in question and all of its sub-albums (well, not all, but all sub-albums which have nested albums in them) that the name of the album would start with 3 letters "XXX" (choose whatever you like)
  • added the following code to album.header/footer etc., wherever I needed to know:
    <?php if (("XXX" != substr($gallery->album->fields["parentAlbumName"],0,3)) AND ("XXX" != substr($gallery->album->fields["name"],0,3))) {?>
    

    (the IF checks if we're NOT inside one of the 'critical' albums and if so, it will execute the code which prints additional footer-info)

Works fine for the way I use it, since applying that naming-convention is not a problem with the way the stuff is organized.
But still it would be nice to know if there was a better way to handle it, without relying on such naming conventions, so I would appreciate any comments...

Cheers

Michael

P.S: since that specific gallery is for registered users only, you can't see the effect of not showing the mods, but feel free to browse my gallery @ http://3baas.de/fotos[/]

 
solsurfer

Joined: 2004-11-03
Posts: 36
Posted: Mon, 2004-12-13 23:13

This worked great! The only hiccup I'm getting is that when you go back to the main gallery page from this album with a customized header, the main album page (album.php) does not include the wrapper.header file unless I refresh the page. Any clues as to how to solve this?

You can see what I mean by starting here:
http://www.thestoddards.com/gallery/elle, then select the main gallery link (The Stoddard Photo Gallery). Notice there is no header. Now hit F5 to refresh the page, and you'll see the header.

Thanks for any help anyone can provide.

 
Gaile

Joined: 2002-07-20
Posts: 1301
Posted: Fri, 2004-12-17 21:08
solsurfer wrote:
This worked great! The only hiccup I'm getting is that when you go back to the main gallery page from this album with a customized header, the main album page (album.php) does not include the wrapper.header file unless I refresh the page. Any clues as to how to solve this?

You've got two body tags in there - maybe that's part of the problem?

Gaile

 
solsurfer

Joined: 2004-11-03
Posts: 36
Posted: Sat, 2004-12-18 00:56
PixelPoet wrote:
solsurfer wrote:
This worked great! The only hiccup I'm getting is that when you go back to the main gallery page from this album with a customized header, the main album page (album.php) does not include the wrapper.header file unless I refresh the page. Any clues as to how to solve this?

You've got two body tags in there - maybe that's part of the problem?

Gaile

Thanks, Gaile. That helped me debug it a bit more. It's not actually the double body tags, but it looks like the is not including wrapper.header on the intial page load (and thus no header), and is including it on the refresh (then the header showing). This is consitently happening when coming from a page with a custom header.

I'm using

<?php 
global $gallery; 
if (strncmp($gallery->album->fields["name"], "elle",4)) {
if (strncmp($gallery->album->fields["name"], "esb",3)) { 
?>

to control whether or not the wrapper is included, and it seems to work well with this one hiccup. Is it possible that it's holding the "elle" in memory when it first loads the page?

Any suggestions on things to try would be much appreciated.

Thanks,

Rod

 
StephaneT
StephaneT's picture

Joined: 2004-07-24
Posts: 26
Posted: Sun, 2005-04-03 17:15

I read this post as I would also like to have differents header for differents albums (actually a logo for a white background and another one for a dark background). I tried to follow the steps, but I might missing something...

The default header well shows up on all albums including the one which is named "Chine" (Chine.header well exists !) :

album.header

Quote:
<?php global $GALLERY_BASEDIR;
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
include($albumheader);
} else { ?>

<div align="left">
<p><a href="http://www.pictur.net/"><img src="http://pictur.net/tools/LogoPicturnet.gif" height="95" width="451" border="" ></a></p>
</div>

<table width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
<tr valign="middle">
<td class="leftspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
<tr>
<td class="mod_toplight_left" align="right"></td>
<td nowrap class="head" align="left">
<?php echo $gallery->album->fields["title"] ?>
</td>
<td class="mod_toplight_right" align="left">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="mod_under_hl"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<?php } ?>

Chine.header

Quote:
<?php
includeHtmlWrap("wrapper.header");
?>

<table width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
<tr valign="middle">
<td class="leftspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
<tr>
<td class="mod_toplight_left" align="right"></td>
<td nowrap class="head" align="left">
&<?php echo $gallery->album->fields["title"] ?>&
</td>
<td class="mod_toplight_right" align="left">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="mod_under_hl">this is the custom album01 header</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">

http://pictur.net/gallery/Chine (Gallery v1.5-RC2 )

Any help would be much appreciated.

Stéphane.

 
leslienord

Joined: 2003-09-08
Posts: 75
Posted: Sat, 2005-05-21 16:56
leslienord wrote:
Spaces! Not the ones at lines 20 & 21 but the t and t were actually spaces that as soon as I removed them - Voila! Two sucesses in one day - I feel very blessed.

THANK YOU!

Leslie

I just upgraded the gallery I used the custom header code on to version 1.5 and it no longer displays the custom headers. What needs to be changed?

Thanks again,
Leslie

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2005-05-21 17:53
<?php // include custom album header
$GALLERY_BASEDIR = dirname(__FILE__); 
$albumheader = $GALLERY_BASEDIR . '/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
    include($albumheader);
} else { ?>
 
leslienord

Joined: 2003-09-08
Posts: 75
Posted: Sat, 2005-05-21 18:03
floridave wrote:
<?php // include custom album header
$GALLERY_BASEDIR = dirname(__FILE__); 
$albumheader = $GALLERY_BASEDIR . '/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
    include($albumheader);
} else { ?>

Thank you once again - worked like a charm.

Leslie

 
fiunary

Joined: 2005-05-31
Posts: 7
Posted: Thu, 2005-06-02 20:57

Hi, I am having problems implementing this - trying to get different albums to have different headers.

If I use the default album.header it works:

<?php
// This is the default album header (for the gallery
// page: view_album.php). It's companion is album.footer.default.
//
// To override this header, create a file called album.header
// in this directory.
//
// NOTE: This header gets inserted below the <body> tag.
//
// Some tips:
// * Some application variables:
// - Gallery Title: $gallery->app->galleryTitle
// - Album Title: $gallery->album->fields["title"]
//
// $Id: album.header.default,v 1.17 2004/07/17 11:35:20 jenst Exp $
?>

<?php
includeHtmlWrap("wrapper.header");

if (!includeTemplate('album.header.tpl')) {
?>
<table width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
<tr valign="middle">
<td class="leftspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
<tr>
<td class="mod_toplight_left" align="right"></td>
<td nowrap class="head" align="left">
&<?php echo $gallery->album->fields["title"] ?>&
</td>
<td class="mod_toplight_right" align="left">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="mod_under_hl"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<?php
}
?>

If I paste in the code from this topic (the various versions) the html rendering stops at the <body> tag and I get a blank page?

<?php
// This is the default album header (for the gallery
// page: view_album.php). It's companion is album.footer.default.
//
// To override this header, create a file called album.header
// in this directory.
//
// NOTE: This header gets inserted below the <body> tag.
//
// Some tips:
// * Some application variables:
// - Gallery Title: $gallery->app->galleryTitle
// - Album Title: $gallery->album->fields["title"]
//
// $Id: album.header.default,v 1.16 2003/10/20 02:20:23 john_kirkland Exp $
?>
<?php global $GALLERY_BASEDIR;
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
include($albumheader);
} else { ?>
<?php
includeHtmlWrap("wrapper.header");
?>

<table width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
<tr valign="middle">
<td class="leftspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
<tr>
<td class="mod_toplight_left" align="right"></td>
<td nowrap class="head" align="left">
&<?php echo $gallery->album->fields["title"] ?>&
</td>
<td class="mod_toplight_right" align="left">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="mod_under_hl"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<?php } ?>

What am I doing wrong. Many thanks for your help.

Alex

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2005-06-02 22:25

http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=140944#140944

add replace
global $GALLERY_BASEDIR;
with
$GALLERY_BASEDIR = dirname(__FILE__);

 
fiunary

Joined: 2005-05-31
Posts: 7
Posted: Thu, 2005-06-02 22:36

Thanks for your reply I have made this change and now have:

<?php
// This is the default album header (for the gallery
// page: view_album.php). It's companion is album.footer.default.
//
// To override this header, create a file called album.header
// in this directory.
//
// NOTE: This header gets inserted below the <body> tag.
//
// Some tips:
// * Some application variables:
// - Gallery Title: $gallery->app->galleryTitle
// - Album Title: $gallery->album->fields["title"]
//
// $Id: album.header.default,v 1.16 2003/10/20 02:20:23 john_kirkland Exp $
?>
<?php global $GALLERY_BASEDIR = dirname(__FILE__);
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
include($albumheader);
} else { ?>
<?php
includeHtmlWrap("wrapper.header");
?>

<table width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
<tr valign="middle">
<td class="leftspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
<tr>
<td class="mod_toplight_left" align="right"></td>
<td nowrap class="head" align="left">
&<?php echo $gallery->album->fields["title"] ?>&
</td>
<td class="mod_toplight_right" align="left">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="mod_under_hl"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<?php } ?>

But it still won't work. I don't know anything about PHP. Should I have put in a real name for__FILE__? Your help much appreciated.

alex

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2005-06-02 22:41

<?php global $GALLERY_BASEDIR = dirname(__FILE__);
remove the word global

 
fiunary

Joined: 2005-05-31
Posts: 7
Posted: Mon, 2005-06-06 01:51

Thanks floridave,

I am not doing well on this one. I now have:

<?php
// This is the default album header (for the gallery
// page: view_album.php). It's companion is album.footer.default.
//
// To override this header, create a file called album.header
// in this directory.
//
// NOTE: This header gets inserted below the <body> tag.
//
// Some tips:
// * Some application variables:
// - Gallery Title: $gallery->app->galleryTitle
// - Album Title: $gallery->album->fields["title"]
//
// $Id: album.header.default,v 1.16 2003/10/20 02:20:23 john_kirkland Exp $
?>
<?php $GALLERY_BASEDIR = dirname(__FILE__);
$albumheader = $GALLERY_BASEDIR . '/html_wrap/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
include($albumheader);
} else { ?>

<table width="100%" border="0">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner">
<tr valign="middle">
<td class="leftspacer"></td>
<td>
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg">
<tr>
<td class="mod_toplight_left" align="right"></td>
<td nowrap class="head" align="left">
<?php echo $gallery->album->fields["title"] ?>
</td>
<td class="mod_toplight_right" align="left">
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="mod_under_hl"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<?php } ?>

At least the page is rendering....

I have an album name mjp (url ...www.xxx.com/gallery/mjp). I have a file mjp.header in the html_wrap drirectory. I have writen "test" in this file - have also tried proper html.

The problem is that the page for the mjp album is rendering with the default.header table?

Any ideas what I am doing wrong?

Many thanks once again,

Alex

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2005-06-06 03:08

real urls would be helpfull PM me if you don't want the world to see what is on the world wide web.
and wrap your code in code tags!

Dave

 
fiunary

Joined: 2005-05-31
Posts: 7
Posted: Mon, 2005-06-06 06:20

Sorry. At the moment I just have guff on the site... www.bellfish.net/gallery/mjp

Regards, Alex

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2005-06-06 20:23

try this as your /html_wrap/album.header

<?php 
// This is the default album header (for the gallery 
// page: view_album.php). It's companion is album.footer.default. 
// 
// To override this header, create a file called album.header 
// in this directory. 
// 
// NOTE: This header gets inserted below the <body> tag. 
// 
// Some tips: 
// * Some application variables: 
// - Gallery Title: $gallery->app->galleryTitle 
// - Album Title: $gallery->album->fields["title"] 
// 
// $Id: album.header.default,v 1.16 2003/10/20 02:20:23 john_kirkland Exp $ 
?> 
<?php $GALLERY_BASEDIR = dirname(__FILE__); 
$albumheader = $GALLERY_BASEDIR . '/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) { 
include($albumheader); 
} else { ?> 

<table width="100%" border="0"> 
<tr> 
<td> 
<table cellpadding="0" cellspacing="0" width="100%" border="0" align="center" class="mod_headliner"> 
<tr valign="middle"> 
<td class="leftspacer"></td> 
<td> 
<table cellspacing="0" cellpadding="0" class="mod_toplight_bg"> 
<tr> 
<td class="mod_toplight_left" align="right"></td> 
<td nowrap class="head" align="left"> 
<?php echo $gallery->album->fields["title"] ?>
</td> 
<td class="mod_toplight_right" align="left"> 
</td> 
</tr> 
</table> 
</td> 
</tr> 
</table> 
<table width="100%" cellpadding="0" cellspacing="0"> 
<tr> 
<td class="mod_under_hl"></td> 
</tr> 
</table> 
</td> 
</tr> 
<tr> 
<td valign="top"> 
<?php } ?>
 
fiunary

Joined: 2005-05-31
Posts: 7
Posted: Mon, 2005-06-06 21:52

Fantastic. A quick question - why / and not /html_wrap/? I was assuming that the GALLERY_BASEDIR was the gallery directory?

Thanks again.

Alex

 
dl22

Joined: 2005-07-02
Posts: 7
Posted: Wed, 2005-07-13 19:40

I've got the customized headers working well, but am having a hard time coding the album.footer to get it to choose a different footer for each album. I'm using the following code:

<?php // include custom album footer
$GALLERY_BASEDIR = dirname(__FILE__);
$albumheader = $GALLERY_BASEDIR . '/' . $gallery->album->fields["name"] . '.footer';
if (fs_file_exists($albumfooter) && !broken_link($albumfooter)) {
    include($albumfooter);
} else { ?>

Where should I insert it in my album.footer file to make this work?

Thanks,
Dirk

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2005-07-13 20:56

it should go at the top, did you put the closing brace at the bottom?

 
dl22

Joined: 2005-07-02
Posts: 7
Posted: Thu, 2005-07-14 05:40

Thanks. The ending bracket did the trick.

One more question. Is there a way to change the album.header code below ...

<?php // include custom album header
$GALLERY_BASEDIR = dirname(__FILE__);
$albumheader = $GALLERY_BASEDIR . '/' . $gallery->album->fields["name"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
    include($albumheader);
} else { ?>

... so that subalbums automatically use the parent album's header if its own header file doesn't exist?

Thanks,
Dirk

 
rhythmgtr5

Joined: 2005-05-11
Posts: 4
Posted: Sat, 2005-07-16 01:47

I was wondering if anyone could tell me if the information in this thread could be used for what I'm trying to do.

Right now I'm using the wrapper.header file to put my menu on both the "photos" and "portfolio" sections of my site.

http://www.shatterthelens.com/mygallery/photos

But as you can see, the menu is the same for both. Ideally in the Photos section, I would use the .jpg with :Photos: and in the Porfolio section i would use the jpg with :Porfolio:, but right now it's always photos.

Thanks in advance :D

 
dl22

Joined: 2005-07-02
Posts: 7
Posted: Sat, 2005-07-16 20:56

I've figured out a way to have child albums default to a parent album's header, modifying the code a bit. I suppose this wouldn't work on a child album of a child album, but there's probably a way to work around that somehow.

<?php // include custom album header
$GALLERY_BASEDIR = dirname(__FILE__);
$albumheader = $GALLERY_BASEDIR . '/' . $gallery->album->fields["name"] . '.header';
$parentalbumheader = $GALLERY_BASEDIR . '/' . $gallery->album->fields["parentAlbumName"] . '.header';
if (fs_file_exists($albumheader) && !broken_link($albumheader)) {
    include($albumheader);
} else
if (fs_file_exists($parentalbumheader) && !broken_link($parentalbumheader)) {
    include($parentalbumheader);
} else { ?>

This first checks for a custom header for a particular album. If it doesn't find it, it will use its parent album's custom header. If it doesn't find either, it'll use album.header.

Dirk

 
gallery_gouki

Joined: 2007-04-01
Posts: 2
Posted: Tue, 2007-06-05 10:03

How to use this Coding in the Gallery. thanks you

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2007-06-05 13:47

G1 or G2?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team