Support Forums | Demo Gallery [1.x] [2.x] | Downloads | News | Site Map ]
Nuked Gallery
  Create a FREE account or Login   As a guest, you don't have access to our FULL navigation system.
 Forum FAQForum FAQ   StatisticsStatistics   SearchSearch   UsergroupsUsergroups   FavoritesFavorites  

Dynamic titles for Gallery, anyone?

 
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Gallery 1 Integration View previous topicPrinter friendly versionView next topic
Author Message
Aylwin

Novice
Novice


Joined: Sep 16, 2003
Posts: 27

PostPosted: Sat Dec 27, 2003 5:41 pm    Post subject: Dynamic titles for Gallery, anyone? Reply with quote

I've learned that Google Tap with Dynamic Titles can be a very powerful combination. For those who don't know what dynamic titles are, simply observe your browser's title bar as you navigate this website. Smile

Anyway, the standard dynamic titles distribution doesn't include support for Gallery though. So now, you can insert this into you dynamic_titles.php:

Code: › // gallery
if($name=="gallery"){
$newname = "Photo Gallery";  //or whatever if you want to change the name
global $gallery;
   if ($gallery->session->albumName != "") {
   $albumname = $gallery->album->fields["title"];
   $newpagetitle = "$item_delim $newname $item_delim $albumname";
   }
   else {
   $newpagetitle = "$item_delim $newname";
   }
}


It's not perfect but it's a start. Right now, it only displays the album title but not the photo's caption/title if you view a photo. I've been trying to figure out how to do this but I'm stuck. Can someone help?

If you want to see my dynamic titles for Gallery working click HERE [cal-family.org].
Back to top
Offline View user's profile Send private message Visit poster's website
AdBot
   Post subject: Dynamic titles for Gallery, anyone?  

Back to top
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 29, 2003 8:50 am    Post subject: Re: Dynamic titles for Gallery, anyone? Reply with quote

actually, there are several ways to get this working..i'll see what i can do.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 29, 2003 9:18 am    Post subject: Re: Dynamic titles for Gallery, anyone? Reply with quote

demo found at http://phpnuke.nukedgallery.net/gallery.html [nukedgallery.net].

edit as follows (note: all line numbers reference Gallery 1.4.2-cvs-b5, but should be close for 1.4.1):

open view_photo.php.
find, on or about line 114:
PHP: › <?php $photoURL $gallery->album->getAlbumDirURL("full") . "/" $image->name "." $image->type;
list(
$imageWidth$imageHeight) = $image->getRawDimensions(); ?>

add after:
PHP: › <?php $pagetitle "» $name » ".$gallery->album->fields['title']." » ".$image->name?>

save and close.

open view_album.php.
find, on or about line 67:
PHP: › <?php $albumName $gallery->session->albumName?>

add after:
PHP: › <?php $pagetitle "» $name » ".$gallery->album->fields['title']; ?>

save and close.

open index.html.
find, on or about line 50:
PHP: › <?php $GALLERY_EMBEDDED_INSIDE='nuke'?>

add after:
PHP: › <?php $pagetitle "» $name"?>

save and close.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
Aylwin

Novice
Novice


Joined: Sep 16, 2003
Posts: 27

PostPosted: Mon Dec 29, 2003 5:03 pm    Post subject: Re: Dynamic titles for Gallery, anyone? Reply with quote

Thanks! As usual, you make it look so easy! Very Happy Although (I think) my implementation of dynamic titles isn't exactly the same I got the idea and now it works!

By the way, how do I get the caption instead of the image name? A lot of my image names are aaa, aab, etc. The captions are more meaningful though.

[edit]
Okay, I came up with something. I'm sure there's a much easier way though. Laughing

Code: › $imageid = $gallery->album->getPhotoIndex($id);
$caption = $gallery->album->getCaption($imageid);


[/edit]
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Mon Dec 29, 2003 8:39 pm    Post subject: Re: Dynamic titles for Gallery, anyone? Reply with quote

Yeah, there's an easier way Wink
i'll post it tomorrow AM (need to get to bed, i have the flu Sad )
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
Aylwin

Novice
Novice


Joined: Sep 16, 2003
Posts: 27

PostPosted: Tue Dec 30, 2003 6:36 am    Post subject: Re: Dynamic titles for Gallery, anyone? Reply with quote

Take it easy then. No hurry. Get well soon!
Back to top
Offline View user's profile Send private message Visit poster's website
dari

Site Admin
Site Admin


Joined: Mar 03, 2003
Posts: 6284
Location: Washington Township, NJ, USA

PostPosted: Tue Dec 30, 2003 8:45 am    Post subject: Re: Dynamic titles for Gallery, anyone? Reply with quote

in view_photo.php (undo the stuff I said from above for the file)...
find, on or about line 114:
PHP: › <?php $photoURL $gallery->album->getAlbumDirURL("full") . "/" $image->name "." $image->type;
list(
$imageWidth$imageHeight) = $image->getRawDimensions(); ?>

add after:
PHP: › <?php $pageCaption $gallery->album->getCaption($index);
if (
trim($pageCaption) == "") {                         
        
$pageCaption=$gallery->album->getPhotoId($index);                              
}                                
$pagetitle "&raquo; $name &raquo; ".$gallery->album->fields['title']." &raquo; ".$pageCaption?>


save and close.

what this does is put the caption in the title bar, and if it doesn't have a caption, it puts in the photo's ID. see http://phpnuke.nukedgallery.net/gallery-photo_Rameens-trip-to-WA-pearygin_lake.html [nukedgallery.net] for an example w/ caption, http://phpnuke.nukedgallery.net/gallery-photo_maine2003-P1010018.html [nukedgallery.net] for an example w/o caption.
_________________
Back to top
Offline View user's profile Send private message Visit poster's website
keyrat

Beginner
Beginner


Joined: May 23, 2005
Posts: 19

PostPosted: Wed Mar 29, 2006 1:23 pm    Post subject: Re: Dynamic titles for Gallery, anyone? Reply with quote

^bump^

anyone get this working in 1.5? i can't seem to find the lines cited.
Back to top
Offline View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NukedGallery.net Forum Index » PHP-Nuke Integration » Gallery 1 Integration View previous topicPrinter friendly versionView next topic

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours

Powered by phpBB © phpBB Group



Sponsors: Web HostingDedicated ServersDomain NamesDomain Name RegistrationDedicated Web HostingSEO Search Engine OptimisationSEOWeb Design New YorkSEO Web DesignWeb hosting AustraliaCheap Web Design

6th year online! 2003-2009
Legal • Use of this site consitutes agreement to the Acceptable Use Policy
Hosted by Implosion WorksSourceForge.net Logo • Theme by TonicMedia