add different text to header of albums

npereira

Joined: 2002-09-24
Posts: 114
Posted: Fri, 2003-05-16 18:47

Ok,

I have gallery imbeded in postnuke if that makes any difference.

Is it possible to show a header text for just a certain album?
The reason I ask, is I have several albums and I would like to have a text
appear on each album in the header, but each album has to have a different text.

Is this at all possible?

Regards,

 
ppmnt
ppmnt's picture

Joined: 2003-01-12
Posts: 238
Posted: Fri, 2003-05-16 19:57

Yes, it is. But how easy or hard that would be depends on what the text would be. Would it be something like the album name? Or a long description that could be different for each album?

If it is the first one, just read through album.header.default, it shows how to get the variable that contains the album title.

If it is the latter, one idea would be to

1) Create a subdirectory in html_wrap called albums.
2) In that directory you could store your custom headers, each in a file that has the same name as the album (e.g. album01, album02, vacation_2002, whatever).
3) In album.header (make sure you make a copy of album.header.default and modify the copy), just do a php include:

$name= $gallery->album->fields["name"] ;
<?php include '/home/user/public_html/gallery/html_wrap/albums/$name; ?>

I haven't tried this, but it sounds fairly easy.

 
npereira

Joined: 2002-09-24
Posts: 114
Posted: Fri, 2003-05-16 20:29

Ok thanks,

It's the later I needed. I'll try that!

Tahnks again

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Fri, 2003-05-16 22:04

Well I have to pitch my (sorry) more elegant version of this: album summary

 
ppmnt
ppmnt's picture

Joined: 2003-01-12
Posts: 238
Posted: Sat, 2003-05-17 16:02
joan wrote:
Well I have to pitch my (sorry) more elegant version of this: album summary

Joan,

I believe your album summary is for having album info on the page above the photo thumbnails, not in the header, right? I think npereira wanted to have custom headers.

But even for headers it would be more elegant, as you put it, to use your mod and then call one of the fields in the album.header. I was just brainstorming a quick way of doing it.

~Eva

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Sat, 2003-05-17 16:15

Hmm, interesting idea, someone using a technical term correctly. It never crossed my mind that when he used header he mean "header"!

Oh well, he has two solutions, so he can pick and chose.

 
ppmnt
ppmnt's picture

Joined: 2003-01-12
Posts: 238
Posted: Sat, 2003-05-17 18:46

npereira -
FYI, if you want to use joan's mod, you should make an additional field called "header" instead of "summary", then print that in the album.header file...

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Mon, 2003-05-19 04:43

Because it's not entirely unrelated:
See this topic

-Beckett (

)

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-05-19 05:51
beckett wrote:
Because it's not entirely unrelated:
See this topic

That link doesn't work

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Mon, 2003-05-19 06:57
joan wrote:
That link doesn't work

Yes it does. For me at least. It's topic 1888, if that helps.

 
npereira

Joined: 2002-09-24
Posts: 114
Posted: Mon, 2003-05-19 12:09

Ok, I'll try both joan 's and ppmnt.

But I'm not to sure what files need modifying apart from classes/Album.php. What other file do I need to modify?

In the classes/Album.php, is this what I need to put in:

$this->fields["header"]="";

and putting in this in album.header:
$name= $gallery->album->fields["header"] ;

<?php include $header; ?>

In view_album.php add this:

After:
if ($gallery->user->canChangeTextOfAlbum($gallery->album)) {

add this:
+ $adminCommands .= '<a href="#" onClick="'.popup("edit_field.php?set_albumName=" .

+ $gallery->session->albumName.

+ "&field=header").

+ '">[edit header]</a>&';

and add this just before <!-- image grid table --> :

+<?php

+if ($page == 1)

+{

+ print "<center>".$gallery->album->fields["header"]."</center>";

+}

+?>

Anything else I'm missing?

 
npereira

Joined: 2002-09-24
Posts: 114
Posted: Mon, 2003-05-19 12:37

This works like a charm!

It should be added to the next release of Gallery! Now you don't need to edit the album.header if you want specific headers in your different albums.

Thanks all for your help!

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-05-19 12:55

Funny you should say that. I've just pictched it for inclusion into 1.3.4.

We'll see what the rest of the team say

 
npereira

Joined: 2002-09-24
Posts: 114
Posted: Mon, 2003-05-19 13:02

This is an easy addon. I don't see why they would reject it.
This software is getting SOOOOO GOOD ! I'm telling all my friends, family members, and Webmaster buddies that have somekind of album photo on the web to install it.

The Support of this is so good! I'm learning new things everyday! Thanks again Joan!