change title

taskmaster
taskmaster's picture

Joined: 2004-12-01
Posts: 135
Posted: Wed, 2011-07-20 11:11

hello gallery is 1.6 I think, but I dont think it will influnce the q and a.

I need to change title on view.photo now its <title><?php echo $gallery->album->fields["title"] . ' - '. $title ;?></title> but what i want it that only the title show, how do i do this, thanks in advance

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2011-07-20 20:13

Hello,

what is "the title" for you?

Actually you found the right code line to change.
Either make it

<title><?php echo $gallery->album->fields["title"]; ?></title>
or
<title><?php echo $title; ?></title>

Cheers,

Jens
--
Gallery 1 Developer

 
taskmaster
taskmaster's picture

Joined: 2004-12-01
Posts: 135
Posted: Wed, 2011-07-20 20:43

if i use this <title><?php echo $title; ?></title> it looks like in page source "picture_like_this" but it should look like "picture like this" is there somthing I could do there, also how would the code look if I wanted the title first and album after.

Another question which site has the most visits what you know of that uses gallery, just curious.

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2011-07-20 21:05

So you want to remove the _ from the title?
<title><?php echo strtr($title, '_', ' ') ; ?></title>

The other thing would be:

<title><?php printf ("%s %s", $gallery->album->fields["title"], strtr($title, '_', ' ')) ; ?></title>

You can format the output be modifying the string "%s %s".
E.g. "Album: %s -- Photo: %s"

Jens
--
Gallery 1 Developer

 
taskmaster
taskmaster's picture

Joined: 2004-12-01
Posts: 135
Posted: Wed, 2011-07-20 21:25

as you know by now, im no php nerd <?php echo $metakeywords;?> what is that is it maybe possible to use that as title, be cause it is maybe more clean and image no. or something. I tryed to past in the title but did not work, I just try to understand this and MANY THANKS for your replys