New Modules: About this photo; About this album

undagiga

Joined: 2010-11-26
Posts: 693
Posted: Thu, 2011-07-28 09:59

I am on the road at present a long way from home with no capacity to look into this further at the moment. It will be several weeks at least. Given my last attempt top isolate what is causing this, what I am likely to need is admin access to a gallery where this happens. If someone could set up a demo gallery with these images / albums that would help.

U-G

 
wise_mike

Joined: 2008-10-21
Posts: 158
Posted: Thu, 2011-08-11 03:15

Everything was working fine, and I uploaded some new images to an album, and suddenly for the root album of where I was uploading, I get a blank page.. and when I uncheck "About this Album" from the modules page, the problem is fixed and I can see the page..
- I have the latest G version (Gallery 3.0.2)
- the logs show nothing strange other than some "error: File not found" lines..
- I tried to use a clean install of the module, same error..
- maintenance> I tried the "Fix your Gallery" button, rebuilding, clean up tags.. but same problem..
- I use the default wind theme
- other details: Operating system: Linux 2.6.32-29-server - Apache: Apache/2.2.14 (Ubuntu) - PHP: 5.3.2-1ubuntu4.7 - MySQL: 5.1.41-3ubuntu12.10 - Graphics toolkit: imagemagick

Thanks,

 
Stan T

Joined: 2011-04-27
Posts: 52
Posted: Tue, 2011-08-16 19:57

Hi,
I have a real problem with view counts in the about module. This morning I reset view counts and viewed a couple, count was 2. Later this morning, it was 32. 2 hours later it was 3500. I went out for an hour and it is 15,000. I know that this site is good, but not anywhere like this. I am interested in the other information that about provides, but, I have to remove the views or the whole about module. I would like to see an option in this module to not show views. Does anyone know if I can remove the views or another possible easy fix?
Thanks,
Stan

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-08-17 23:48

@wise_mike: There are a few people who have your problem. I honestly don't know why it happens, although if you read the discussion with pinn8 earlier in this thread you'll see that we narrowed it down to the module code that adds up the view counts. I've had a long look at the code and at websites where it occurs, and I can't see why this code causes problems on these sites.

I'm prepared to spend the time to investigate further if someone will give me access to a site where it happens. Preferably a duplicate test site containing albums that exhibit the problem.

Failing that, if you want to continue using the module, then remove the view counts code both of the module's php files. The discussion above with pinn8 demonstrates what code to take out in the helper file and the following reply to Stan indicates what code take out in the view file.

An alternative would be to replace the code in the helper file with the more conventional album views code, that just gets views of the album page itself rather than adding up all the views of the photos within the album.

@Stan T: My best guess is that it's search engines incrementing the count. I had a similar experience with my site. I don't think that there's anything I can do about it in this module, which just adds up the counts recorded in the DB. I imagine that a module could be written to stop search engines incrementing the count, but that would be a separate module.

To stop the views item being displayed, the simplest approach would be just to delete the following lines from about_this_photo\views\about_this_photo.html.php:

<tr>
    <td><strong class="caption"><?= t("Views:&nbsp;") ?></strong></td>
    <td><?= $vcount ?></td>
</tr>

and the exact same lines from about_this_album\views\about_this_album.html.php.

U-G

 
Stan T

Joined: 2011-04-27
Posts: 52
Posted: Wed, 2011-08-17 10:58

Thank you
Stan

 
wise_mike

Joined: 2008-10-21
Posts: 158
Posted: Thu, 2011-08-18 01:13

Thanks undagiga.. I removed the lines 50-54 from the "about_this_album_block.php" file and it works great..

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-08-17 23:50

I'm glad that everyone is happy, but I'd still prefer to find cause, if someone can provide me with a test site.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-06-21 04:54

Not extensively tested but should help.
I added a new line for movie counts and I hope I fixed the sub-album count of views of items.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Fri, 2012-06-22 19:58

This version works well on my site, where previously I've been confronted by the white screen others have noted, thanks. I did have to make one change in about_this_album.html.php:

  <? if (isset($description) && ($description <> "")): ?>

(Check isset($description) before trying to use the value) This continues a trend of problems I've had since Debian upgraded to php 5.4.4...I'm starting to wonder if something funny has happened with my php configuration or if this is really just a byproduct of the upgrade.

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Fri, 2012-06-22 20:03

Similar problems with $all_tags in the same file:

  <? if (isset($all_tags) && (count($all_tags) > 0)): ?>

...

    <? if (isset($all_tags) && (count($all_tags) > 0)): ?>
 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Sat, 2012-06-23 01:06

...and one more, when mapping an album with exif_gps, in helpers/about_this_album_block.php:

      if (isset($item) && $theme->item->is_album()) {