"Old-style" captions with 1.4.1-pl1 and view_album

phule

Joined: 2002-08-23
Posts: 58
Posted: Wed, 2004-01-28 03:59

Hello,

Just a quick question. Below is some code from a diff file I happened to save. This is code to change the format of the captions under the thumbnail so that it is not restricted by the width of said thumbnail.

I was wondering how this can be applied to the current 1.4.1-pl1 setup. Up until yesterday I had been using 1.3.3 with the various patches put in place by hand. But when I went and looked at the view_album.php file from the latest release, I wasn't sure where the changes should be made to return my gallery to its previous behavior.

My initial reaction was that the change could be made on line 823, but I wasn't certain if it was that simple and/or if that would do it for all cases or just for most cases (login vs. admin vs. non-user, etc)

Thanks for any help you can offer.

diff -r -C 3 photos-1.3/view_album.php photos/view_album.php
*** photos-1.3/view_album.php	Fri Aug 23 10:39:18 2002
--- photos/view_album.php	Fri Aug 23 10:42:33 2002
***************
*** 406,413 ****
  				echo makeFormIntro("view_album.php", array("name" => "image_form_$i")); 
  			}
  
! 			echo "<table width=90% border=0 cellpadding=0
! cellspacing=4><tr><td><span class=\"caption\">";
  			$id = $gallery->album->getPhotoId($i);
  			if ($gallery->album->isHidden($i)) {
  				echo "(hidden)<br>";
--- 406,412 ----
  				echo makeFormIntro("view_album.php", array("name" => "image_form_$i")); 
  			}
  
! 			echo "<table width=$iWidth border=0 cellpadding=0 cellspacing=4><tr><td><span class=\"caption\">";
  			$id = $gallery->album->getPhotoId($i);
  			if ($gallery->album->isHidden($i)) {
  				echo "(hidden)<br>";
 
phule

Joined: 2002-08-23
Posts: 58
Posted: Wed, 2004-01-28 17:13

Ok, I think I solved it.

Take this code:

			echo '<table width="' . $gallery->album->fields['thumb_size']
				. '" border="0" cellpadding="0" cellspacing="4"><tr><td class="modcaption">';
			$id = $gallery->album->getPhotoId($i);
			if ($gallery->album->isHidden($i) && !$gallery->session->offline) {
				echo "(" . _("hidden") .")<br>";
			}

And change it to this:

			echo '<table width="90%" border="0" cellpadding="0" cellspacing="4"><tr><td class="modcaption">';
			$id = $gallery->album->getPhotoId($i);
			if ($gallery->album->isHidden($i) && !$gallery->session->offline) {
				echo "(" . _("hidden") .")<br>";
			}

The change is the 90% bit. You can set whatever value you want there. I have no idea how this will affect other parts of Gallery, but it seems to work for the captions fine.