Display hits in sub-albums ON/OFF

bificypdog

Joined: 2004-03-15
Posts: 26
Posted: Wed, 2004-04-07 09:11

Hi,

could you please integrate a handle to switch on/off showing the hits in the sub-albums-tree on the startpage? Perhaps in config.php or via "setup" ?

I changed the util.php like this:
(1.4.3 C2)

function printChildren($albumName,$depth=0) {
	global $gallery;
	$printedHeader = 0;
	$myAlbum = new Album();
	$myAlbum->load($albumName);
	$numPhotos = $myAlbum->numPhotos(1);
	for ($i=1; $i <= $numPhotos; $i++) {
		set_time_limit($gallery->app->timeLimit);
		$myName = $myAlbum->getAlbumName($i);
		if ($myName && !$myAlbum->isHidden($i)) {
		        $nestedAlbum = new Album();
			$nestedAlbum->load($myName);
			if ($gallery->user->canReadAlbum($nestedAlbum)) {
				$val2 = $nestedAlbum->fields['title'];
//				if (!strcmp($nestedAlbum->fields['display_clicks'], 'yes')
//					&& !$gallery->session->offline) {
//				    $val3 = "(" . pluralize_n($nestedAlbum->getClicks(), _("1 hit"), _("hits"), _("0 hits")) . ")";
//				} else {
//				    $val3 = "";
//				}
				if ($depth==0 && !$printedHeader++) {
					echo "<strong>". _("Sub-albums") .":</strong>";
				}
				echo "<div style=\"margin: 0px 0px 0px 20px\">";
				echo "<span class=fineprint>";
				echo "<a href=\"";
				echo makeAlbumUrl($myName);
				echo "\">$val2 $val3</a>\n";
				printChildren($myName,$depth+1);
				echo "</span>";
				echo "</div>";
			}
		}
	}
}

I commented the "if (!strcmp($nestedAlbum->fields['display_clicks'], 'yes')" part.

My Hits should be shown in the album-overview, but not in the sub-albums-tree. It looks much better.

 
bificypdog

Joined: 2004-03-15
Posts: 26
Posted: Fri, 2004-04-09 15:48

I can't describe my suggestion in english.
But another try:

If I active the view-counter, then gallery show the views on the start-page (in the sub-albums-tree) and on within sub-albums, pics and so on.

I just want to deactivate the showing views in the sub-album-tree on the startpage.

What do you think?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2004-05-08 21:30

If you want to show the counter under the sub-album when viewing the parent album and you want to remove the counter from the sun-album tree on albums.php then you can just remove the $val3. So in the above code from util.php you have echo "\">$val2 $val3</a>\n"; change to:echo "\">$val2</a>\n";

Dave

 
aberkvam

Joined: 2004-07-21
Posts: 9
Posted: Fri, 2005-04-15 02:44

Perfect. Just what I was looking to do and I found it in the forums. Still, it would be nice if it was an official option.