New Modules: About this photo; About this album

undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-01-05 12:37

In this thread Bharat kindly started a module that I could use to display various sorts of metadata about images. I've added to it, and created a matching one for albums. They are attached and I've pushed the latest version of "About this photo" to the GIT repository, so it should appear on www.gallerymodules.com when Bharat pulls the changes. I'm not sure if I've been successful in pushing the new module "About this album" to GIT, and may need Bharat's help. I'll update and create codex pages shortly.

"About this photo" displays the following fields:
Data taken
Time taken
Views
IPTC Object Name
IPTC Caption
Tags

If you want different or more IPTC fields, the module is easy to modify.

"About this album" displays the following fields:
Child albums (hidden if there are none)
Number of images
Views (on images therein, not on albums, which is different to the metadata overlay on the thumb)
Album description (hidden if blank)
Tags (of the photos in the album, not of the album itself)

"About this album" displays in a modified form on the root page and is titled "About this site"

There are a couple of threads running where people are asking for the definition of "metadata" (used in thumb overlays etc) to be expanded to include fields like these (hits is already there). My guess is that this will take some time. This is my solution in the meantime. My objective is to minimise the number of modules in the sidebar so that I only need one to display all relevant info.

Thanks to Bharat for getting me started.

U-G

AttachmentSize
about_this_photo_v3.zip2.5 KB
about_this_album_v1.zip2.96 KB
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2011-01-06 02:06

undagiga, Thanks for your contribution!
It would be good if you can create a codex page for each module for some documentation.
there is one already for for the 'about this photo' module and I am sure bharat is fine with you extending and maintaining it. Just login as your forums user id/password and you should be able to edit and create as you see fit.
Let me know if you have issues and I can help out. Perhaps you can get one of the users to help out in this regard so you can keep coding! :-)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2011-01-08 06:30

@undagiga: I see you pushed some changes to your repo, but I can't merge them in until you merge your code with changes that have happened upstream. Read the section in http://help.github.com/forking/ on "pulling in upstream changes". When you pull, you'll likely have some merge conflicts -- resolve them any way that you want (should be easy since you know this code now) and then push back the merged version. Once you've done that, I can just grab your changes and merge them into the main repo. Ask if you have questions.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2011-01-08 09:36

I think I understand the problem. Thanks.

One question I have is that I created an additional module. I tried to add to GIT, but it doesn't look like it was added. After I deal with the upstream issue, can you tell me if I can add a module just by pushing it to my fork, or do you have to add it directly before I can push changes to it?

Dave - I'll create the codex pages once I've got this sorted.

U-G

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Sat, 2011-01-08 09:44

If you create a new module, just "git add modules/<foo>" and then "git commit" to get it committed to your local repo. Then "git push" to send it on up to github where I can do a "git merge" to pull it in with the rest. I don't have to do anything to enable you to do this - except that if I don't like your code I'm free to not merge it in with the rest, and it just stays in your fork :-)
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sun, 2011-01-09 11:44

I've created and tweaked the codex pages. I'll upload screenshots if someone will PM me the upload URL. I haven't been on IRC for many years and I'm not setting it up now just to get the URL.

I've specified the codex as the place to download the modules. How should I specify the URL? Is it something like:

http://www.gallerymodules.com/gallery3-contrib/3.0/modules/about_this_album.zip

or

http://www.gallerymodules.com/download.php?c=gm&f=1

or something else?

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-01-10 07:19

Dave

Thanks for the upload link. I've inserted some screenshots. I noticed that you cleaned up my codex pages a little - much appreciated. I'm still confused about what link to specify for download. The one I used is only for the 3.0 version zip. Some pages just point to www.gallerymodules.com rather than a specific zip - which approach is the preferred community standard?

U-G

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-01-10 14:15

There is no standard yet. I guess if it is in the -contrib repository then gallerymodules.com is the best bet. Then it will be up to date automaticly as you get your pull requests done.
People knowing git will be able to find it anyway. or you can add a note on the codex about your github.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
dwdallam

Joined: 2006-11-19
Posts: 394
Posted: Tue, 2011-01-11 07:26

If a sub album has a description with html, such as <b>text</b> the "Details" will show the HTML also. I have purifier installed too. So you get details that look like this

Details:

<b>This is a great Album</b>

etc. You get the picture.

Se it here:
http://www.dwdallam.com/G3_DWDALLAM/index.php/Client-Proof

Also, it would be nice to have an option to turn of descriptions, since all it does is echo the description of the album in the sidebar--kinda redundant.

 
Retroguy
Retroguy's picture

Joined: 2010-12-29
Posts: 27
Posted: Tue, 2011-01-11 08:04

Hi U-G,

I've installed and had a play with your module. Excellent work.

I have one small critique, however.

From a designer's point of view, the data output should be formatted as a definition list, rather than a table. It is, after all, a list of definitions.

Also, there is really no need to assign 'strong' tags to the captions. You already have a class 'caption' which can be targeted by css. The strong tag will make it hard for theme developers to override your style choices.

Ps, Are you in Canberra/ACT? I'm in Perth.

regards,

http://retroguy.org

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2011-01-11 12:41

@dwdallams

I see your point re the html markup. There must be a routine in the code somewhere that prevents < and > being translated into special characters, because in the thumb overlay it appears as bold rather than <b></b>. In a quick search I couldn't identify what this routine is. Perhaps someone can tell me.

It's a bit hard to provide options without going to all the trouble to construct an admin section. To remove the caption/description simply go to the about_this_photo.html.php file in the views subfolder and delete the following code:

  <div style="margin-top: 10px; margin-bottom: 10px;">
    <strong class="caption"><?= t("Caption:&nbsp;") ?></strong>
    <?= $caption ?>
  </div >

@retroguy

I was waiting for comments like yours. I know the problems that this causes, but I did it this way for several reasons. I tried using unordered lists but was having trouble with too much space being used. I couldn't for the life of me work out why, when other similar modules didn't have this problem. So I ended up removing the lists as a last-ditch option. I went to tables as a way to line things up without lists.

I have hard-wired a few formats because I didn't want to include yet another style sheet. I am having problems with G3 performance and there are already a lot of calls back to the web server - I didn't want to add one more. So there some CSS classes in there for me to refer to in my custom.css, but I wanted a few things to work out of the box without a custom.css, so I hard wired them.

My take on this module is that people will need to edit it a little anyway to suit their needs, as I think they will need different IPTC fields etc. The things you identified are easily removed by those who would like a pure CSS and unordered lists approach.

U-G

P.s. These modules are based on a starter module that Bharat wrote for me. I just went back and checked, and he used <strong class="caption"> tags. rWatcher also does for his similar rwinfo module. So I think it is regarded as standard community practice in this precise context.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2011-01-11 14:00

Some odd discoveries. Out of interest, I went back and recreated a view file based on unordered lists instead of tables. I thought that there could be a version for public release and one I use myself. And this solved both issues.

The spacing problem is gone. I really struggled with this before and now it has just vanished. [puzzled and frustrated look] Personally I prefer the lined-up look, but if you want a set of li lists, use the attached view file (put it in the views subfolder). I found the whole GIT thing a hassle, and may or may not push this version there.

In the process of producing this I might also have solved dwdallams problem, maybe. I was using a slightly different view file than the one I posted. I realised that I had stuck in a call to the html:clean routine in mine that is not in the publicly released version. I took that call out and then the bold text really was bold. I also tested the publicly released view file and same result. So it sounds like this purifier that you have installed is causing the problem. I know it is supposed to produce the opposite effect, but perhaps just disable it and see what happens. Certainly when I use <b>text</b> in the above version of the module, then I get bold text. So if it's not purifier then something on your install is causing your problem. Something in this new theme of yours?

U_G

 
Retroguy
Retroguy's picture

Joined: 2010-12-29
Posts: 27
Posted: Tue, 2011-01-11 14:22

I would argue an unordered list is not the right tool for the job. A definition list is what is required. I have attached what I think is the most semantic approach.

see attachment.

regards,

http://retroguy.org

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2011-01-11 14:35

Interesting idea. I don't use lists very much and I'd completely forgotten about definitional lists. It's not how it's been done in other modules, but that doesn't mean that it's not worth considering. I'll play with it. Thanks.

U-G

 
Retroguy
Retroguy's picture

Joined: 2010-12-29
Posts: 27
Posted: Tue, 2011-01-11 15:42

Using this approach, every individual element can be specifically targeted. In addition, you have lost two levels of totally redundant HTML (themers will love you for this). Also, this is clean, valid and semantic markup, that totally separates style from logic. There are also some SEO benefits.
See what is possible with definition lists here. http://www.maxdesign.com.au/articles/definition/

Quote:
It's not how it's been done in other modules

After spending two weeks negotiating the non-semantic, and highly redundant, HTML nightmare that G3 spits out, I would argue that this is a good thing.

regards,

http://retroguy.org

 
dwdallam

Joined: 2006-11-19
Posts: 394
Posted: Tue, 2011-01-11 22:27

Is this meant to replace the about_this_album.html.php? Rename it?

undagiga wrote:
Some odd discoveries. Out of interest, I went back and recreated a view file based on unordered lists instead of tables. I thought that there could be a version for public release and one I use myself. And this solved both issues.

The spacing problem is gone. I really struggled with this before and now it has just vanished. [puzzled and frustrated look] Personally I prefer the lined-up look, but if you want a set of li lists, use the attached view file (put it in the views subfolder). I found the whole GIT thing a hassle, and may or may not push this version there.

In the process of producing this I might also have solved dwdallams problem, maybe. I was using a slightly different view file than the one I posted. I realised that I had stuck in a call to the html:clean routine in mine that is not in the publicly released version. I took that call out and then the bold text really was bold. I also tested the publicly released view file and same result. So it sounds like this purifier that you have installed is causing the problem. I know it is supposed to produce the opposite effect, but perhaps just disable it and see what happens. Certainly when I use <b>text</b> in the above version of the module, then I get bold text. So if it's not purifier then something on your install is causing your problem. Something in this new theme of yours?

U_G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2011-01-11 23:01
dwdallam wrote:
Is this meant to replace the about_this_album.html.php? Rename it?

The version attached to my post above is meant as a replacement for the one you already have. But you will only see minor layout differences. It won't solve your <b></b> problem. Something else is causing that. I don't get that problem with the version of the module that you were using.

[I initially posted about_this_album.html.php with .txt at the end, but the forum software added a whole lot of underscores _ in the name. To avoid confusion, I edited the post and attached a zip instead. I think Retroguy must have seen my initial post and he attached a xxxx.txt file as well. If you use either of these files it replaces the existing about_this_album.html.php and needs to be named exactly this way.]

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-01-12 04:34

Retroguy

I've had a bit of a play with your approach using definitional lists. It shows promise. It would need a bit of cleaning up to integrate it properly. See the attached screenshot for the image I send Bharat for testing of the character encoding. Perhaps this partly reflects my custom.css

But there's still a challenge to get the formatting tight in just the way I want it. The advantage of tables is that you can make the width for "Date, Time" etc just wide enough for these words and still have column 2 aligned and taking up the rest of the horizontal space. With definition lists you have to specify the width of one or the other in % or pixels or em or something. My experiments indicate that this approach is not as cross-platform and cross-browser robust as you would think. I'm going to stick with tables personally, but I might see if I can get this close enough for public release. I had a play using Firebug, but it's a bit frustrating.

U-G

 
Shemo725

Joined: 2008-04-18
Posts: 424
Posted: Sun, 2011-02-06 07:44

is it possible to not display the tags for albums with this plugin?

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sun, 2011-02-06 11:47
Shemo725 wrote:
is it possible to not display the tags for albums with this plugin?

The simplest way would be to delete the following lines from about_this_album.html.php in the views folder. These lines are towards the end:

  // Print out the list of tags as clickable links.
  $not_first = 0;
  foreach ($display_tags as $one_tag) {
    if ($not_first++ > 0) {
      print ", ";
    }
    print "<a href=\"" . $one_tag[1] . "\">" . $one_tag[0] . "</a>";
  }

You could delete more, but the more you delete the more careful you have to be, so this is the minimal solution.

U-G

 
tlwmsu
tlwmsu's picture

Joined: 2009-09-23
Posts: 21
Posted: Mon, 2011-03-28 22:20

I know this may not be the correct answer, but you can strong-arm your module to show html markup correctly (with the purify module installed.) On line 30 of /modules/about_this_album/views/about_this_album.html.php, I changed

<?= $description ?>

to

<?= $theme->bb2html(html::purify($description), 1) ?>

This is a definition of a hack because I'm just dabbling with Gallery code. Example can be seen here : http://www.buzzardsroost.us/gallery3/index.php/DadW/USMC/Peleliu/Peleliu-Photos

I'm afraid if there is something preventing the purify from already being performed on $description before it is displayed, I'm not smart enough to know what it is or where it could be.

-------------------
Gallery 3 Album Up! (Under Construction and only 2 main albums are public)
http://www.buzzardsroost.us/gallery3

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-03-28 22:33

I'm not sure if this is a comment, a suggestion, or a question. Can you please clarify which it is? Are you expecting to see something different to what's there in your example? I see the red text on the thumbs page. I see that Title and Description are missing from the module in the resize pages, although they appear in the image overlay. Are you saying that your hack above is somehow preventing Title and description from being displayed?

U-G

 
tlwmsu
tlwmsu's picture

Joined: 2009-09-23
Posts: 21
Posted: Mon, 2011-03-28 23:23

Sorry...the forum doesn't seem to show which post I was replying to...there were two posts above regarding html not showing correctly. I guess this was more of a comment regarding the html. Before my change, the text in the Album Info panel showed as :

<P>
Playing the Slideshow in this album will also play "American Anthem" by Norah Jones.
<P>
<P>
<b><font color=red>**** WARNING ****
A few of the pictures are of the dead enemy soldiers and are gruesome.</font></b>

Hope this didn't come across as a complaint...was just trying to get my html coding to show up and thought I'd share. I like the module.

-------------------
Gallery 3 Album Up! (Under Construction and only 2 main albums are public)
http://www.buzzardsroost.us/gallery3

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-03-28 23:48

I agree that it can be hard to following intertwined conversations in the one thread. Selective quotations can help.

So in relation to the albums page, you enabled the purify module, and hacked the code for "About this album" as described above, and you got what you wanted? OK, that's useful to know. Thanks.

In relation to the resize pages and the missing Title and Description, I assume that you inputted these directly into the Gallery title and description fields, whereas the module is looking for them in IPTC. It's not that hard to edit the module to allow for this. Let me know if you want to do this and need assistance.

I guess I could adjust the module to use title and description if IPTC is empty or not found.

U-G

 
tlwmsu
tlwmsu's picture

Joined: 2009-09-23
Posts: 21
Posted: Tue, 2011-03-29 00:52

Yep, yep and yep...I don't have a problem with how the module is handling the IPTC info vs. Gallery title and description, but if you make the changes to logically test for them, I'll be keeping up with this thread and the module for any updates. My album titles and descriptions came over from G2. Regarding this module, I like the album, image and view counts and how it puts the description on the sidebar and not on the main part of the page with thumbnails (which is my only choice in the greydragon theme).

-------------------
Gallery 3 Album Up! (Under Construction and only 2 main albums are public)
http://www.buzzardsroost.us/gallery3

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-03-30 10:45

Here is a quick fix to the missing Title and Description. In modules\about_this_photo\helpers\about_this_photo_block.php change the following code:

		$block->content->name = $record["ObjectName"];
		$block->content->caption = $record["Caption"];

to

		$block->content->name= $item->title;
		$block->content->caption = $item->description;

I have partly tested this in the past and the description part works. The title part therefore should be the same.

I'm a bit busy at the moment to release a new version. There's a lot of hassle to do so, with testing, documentation, pushing to the GIT etc.

U-G

 
tlwmsu
tlwmsu's picture

Joined: 2009-09-23
Posts: 21
Posted: Wed, 2011-03-30 19:30
undagiga wrote:
Here is a quick fix to the missing Title and Description. In modules\about_this_photo\helpers\about_this_photo_block.php change the following code:

		$block->content->name = $record["ObjectName"];
		$block->content->caption = $record["Caption"];

to

		$block->content->name= $item->title;
		$block->content->caption = $item->description;

I have partly tested this in the past and the description part works. The title part therefore should be the same.

I'm a bit busy at the moment to release a new version. There's a lot of hassle to do so, with testing, documentation, pushing to the GIT etc.

U-G

Thanks! Good stuff. Used that as a starting block and I've actually hacked a bit more at it today. It is pretty specific to my Gallery, though. I sure do like the flexibility of "your photos on your website" with source code. Can't be beat.

In combination with your module, my changes and the editcaptured module, I am good to go.

-------------------
Gallery 3 Album Up! (Under Construction and only 2 main albums are public)
http://www.buzzardsroost.us/gallery3

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Fri, 2011-04-01 01:44

I love the idea of these modules.

I am having a problem with HTML that appears in the description for some of my albums. I have the Purifier module enabled, but the link in my description is not displaying properly. Here is a sample.

I see others posted this issue a few weeks ago. Any ideas?

UPDATED: tlwmsu's solution works, so I am good for now.

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Sat, 2011-04-02 11:58

I found an issue with the "about this album" module. At least two of my albums do not function properly when it is enabled. Essentially, I don't see the entire screen -- the header comes up correctly, but no sidebar and no thumbnails for sub-albums/photos. My PHP and Apache logs don't show any errors while I am testing this behavior.

At first, I thought the problem could be related to sub-albums that have special characters in their titles (both of these albums had a sub-album with an ampersand character in the title). I removed the ampersands (replacing them with the word "and"), but the problem remains. The album descriptions do not contain any special characters of html -- just a one sentence description of where and when I took the photos in the album.

The only error in my Gallery log file is a missing favicon (see below for an example), but I also see this error for an album that works fine, so I think it is an unrelated issue.

Quote:
2011-04-02 04:29:54 -07:00 --- error: File not found: Italy/lib/images/favicon.ico

I am running Gallery 3.01 and the GreyDragon 3.0.1 theme. I also tested with the default Wind theme, and the behavior is the same, so I don't think this has anything to do with GreyDragon.

This album shows the problem: http://raia.com/galleries/Italy
This album shows the problem: http://raia.com/galleries/CanRock

None of the other albums I have tried show the error. I currently have 103 albums, so I have not tested them all. Here are two examples that work fine:
http://raia.com/galleries/OBX
http://raia.com/galleries/California

 
tlwmsu
tlwmsu's picture

Joined: 2009-09-23
Posts: 21
Posted: Sat, 2011-04-02 12:36
pinn8 wrote:
I found an issue with the "about this album" module. At least two of my albums do not function properly when it is enabled. Essentially, I don't see the entire screen -- the header comes up correctly, but no sidebar and no thumbnails for sub-albums/photos. My PHP and Apache logs don't show any errors while I am testing this behavior.

What browser are you using? I found errors I made in changing some of the source code on my site with FF's Error Console. That looks just like what my album was doing when I had made errors in my modifications.

Also, I have to say that the example of code I provided works for me and my site. No guarantee it is the "right" thing to do for all sites/themes. I don't claim to be a Gallery developer by any means...I enjoy toying with my site to make it work for me.
-------------------
Gallery 3 Album Up! (Under Construction and only 2 main albums are public)
http://www.buzzardsroost.us/gallery3

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2011-04-02 12:52

Have you made any modifications to the module? If so, please post them.

Can you please post the description for one of these problem albums?

Do the problem albums contain child albums, images or a mixture?

U-G

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Sat, 2011-04-02 14:15

I made 2 customizations:

1. I added the following line to about_this_album.html.php. The purpose was to put some space between the views and the details. I have now removed the line, and the problem remains.

Quote:
<div style="margin-top: 10px; margin-bottom: 0px;">
</div>

2. I copied this existing code in about_this_album_block.php so that is appears in the "About this Site" scenario, becaue I wanted to display the description of my root album. I just removed the line, and the problem remains.

Quote:
if ($item->description) {
$block->content->description = html::clean($item->description);
}

Here are the 2 album descriptions. Nothing special in these fields:

Quote:
Photos taken during a 2009 trip to the Canadian Rockies, including Banff and Jasper National Parks.

Quote:
Photos from Italy

Also, regarding browsers:
I am primarily using Ffox 4. Also tried with IE 8. This behavior is the same with both browsers. IE8 reports a Shadowbox error:

Quote:
Message: Exception thrown and not caught
Line: 34
Char: 3
Code: 0
URI: http://raia.com/galleries/modules/shadowbox/core/players/shadowbox-ajax.js

Both affected albums contain only child albums.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2011-04-02 23:28

OK, I'll have a look and see if I can spot anything when I get a moment. Are you able to tell me if this happens to all albums that contain only child albums or is it not that consistent?

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sun, 2011-04-03 07:29

Well, I can't see what might be causing this behaviour. Like tlwmsu, I would have suspected a typo from the insertions and deletions of code. But generally this would affect all albums, and some are working while some are not. Even so, it's possible there's a typo that only comes into play in certain albums. Can you zip up the module files as they currently are and attach them to a post in this thread? I'll take a look and see if I can spot anything.

If that doesn't turn out to be the issue, then we have to look at the possibilities systematically. Trial and error is sometimes the only way.

1. There are other modules enabled, and it could be one of those. Perhaps you've tried this. I wonder about a problem GPS coordinate in that album that might be causing problems for the mapping module. Does this problem still occur if Ata is the only module that appears in the sidebar? If so, have you turned of "About this album" to see if there is still a problem?

2. If the answer is that the problem still occurs when Ata is the only module in the sidebar, then there has to be something unusual in those galleries that is tripping up the module. There aren't many possibilities. I'm assuming that the number of views, hits and child albums shouldn't be the issue. I need to see the description and tags for myself. Can you then please turn it off so I can look at what's in these albums? Could you also have the "Info" and "Tags In Album" modules activated and displayed in the sidebar. The "Info" module comes with G3 as standard, but you'll need to download "Tags In Album".

Re the Shadowbox error, I don't think that this is the source of the problem, as both FF and IE error consoles show this error for both the working and non-working galleries. It's not clear which versions of G3, Greydragon or Shadowbox you are using. Sounds like Greydragon needs a later version of Shadowbox, or perhaps the other way around.

U-G

 
bognerart
bognerart's picture

Joined: 2007-05-05
Posts: 76
Posted: Sat, 2011-04-23 13:51

Could you please explain your tags according http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/IPTC.html

Is IPTC Caption and Caption-Abstract the same?

There is also UniqueObjectName and ObjectName for IPTC.

I would like it, that the other field is chosen, if the other is empty.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sat, 2011-04-23 14:32

The module gets Title from "5 ObjectName" and Description from "120 Caption-Abstract". These are fairly standard fields, although some software names them differently.

This script relies on the IPTC module and it only detects these two standard fields and not "100 UniqueObjectName".

U-G

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Tue, 2011-04-26 02:09

undagiga -- Sorry it has taken me some time to get back to this. Here is what I have done:

1. I tried disabling all of the non-core modules I am running, but still see the problem.
2. I also re-downloaded the module and implemented it without any changes, but still get the error.
3. Interestingly, I experimented with the AlbumTree module, and see the same problem with it installed -- even my root album does not show up with module enabled.
4. I have attached a copy of the module from my server (should be unmodified from your original).
5. I disabled the module so you can see the names of the sub-albums.

Again, here is an album that has a problem when the about_this_album module is enabled: http://raia.com/galleries/CanRock

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2011-04-26 06:19

This has me stumped. The code you attached seems fine. I really can't see any differences between the working albums and non-working that might be causing this behaviour. I can't see any points of similarity between ATA and Album Tree, as Album Tree uses Title, which ATA doesn't use.

I have on occasion made errors in editing modules that have cause this behaviour. It can be hard to find the error. I don't think there is an error as such in the module, but there has to be some property of the album that I haven't allowed for. As a first step I've attached the html views file from the version that I use myself. It suppresses the display of the Description. If that works then it means that there is something in the description.

If that doesn't work, then the only way I know to find out what is tripping of the module is to delete parts of it, until we know what is tripping it up. Do you feel able to do this?

By the way, which release of Gallery3 are you using? I can see that you're using Greydragon 3.0.4.

U-G

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Tue, 2011-04-26 12:12

I replaced the file with the one you provided. There was no change to the symptoms, so I have turned the module back off.

I am running Gallery 3.01.

I will start working through the module tonight -- commenting out one section at a time until I find which one is causing the issue. Fortunately, this is a small module.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Tue, 2011-04-26 14:24

Please let me know how it goes. If you need any help, just ask.

U-G

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Wed, 2011-04-27 02:19

Making some progress debugging this.

- The bug is definitely not in the "view" file, because the problem remains even if I remove all content except the 1st line of the view file.
- It appears to be related to the "block" file. More specifically, it is tied to the descendant count code in lines 50-54 (shown below). If I remove these lines, all of my albums work fine (except that the view count is 0 since I have removed the code that adds up the view numbers).

Quote:
foreach ($descds as $descd) {
if ($descd->is_photo()) {
$descds_view += $descd->view_count;
}
}

I dumped my "items" table to Excel and started reviewing the view count data more carefully. I did not find any examples where the view count was NULL or any other unexpected value -- all of the photos have a positive integer in this field.

Does this give you any ideas about where else I could look? Thanks.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Wed, 2011-04-27 13:19

Well that's progress I guess. I suspect the problem is with descendants rather than with view count. I suspect it doesn't like something in "foreach ($descds as $descd)".

I'm in a different time zone to you. I'll try to look at it more carefully tomorrow.

U-G

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-04-29 14:15

I've had a look and tried a few things and I can't see what might be causing this. Is there anything different in the albums where the module fails? The nature of the fail suggests that there is something different about the descendants. Are you sure that they are all just albums and jpgs? If so then I am out of ideas. I am not a programming guru, perhaps one of the real gurus has an idea.

Sorry,

U-G

 
tlwmsu
tlwmsu's picture

Joined: 2009-09-23
Posts: 21
Posted: Fri, 2011-04-29 14:48
undagiga wrote:
I've had a look and tried a few things and I can't see what might be causing this. Is there anything different in the albums where the module fails? The nature of the fail suggests that there is something different about the descendants. Are you sure that they are all just albums and jpgs? If so then I am out of ideas. I am not a programming guru, perhaps one of the real gurus has an idea.

Sorry,

U-G

I'm not a Gallery guru, but since the view count fields have already been inspected for null or weird values, the "if ($descd->is_photo())" would be the next part to examine, as you allude to. Maybe something is failing inside of is_photo() function trying to check out the descendant?

-------------------
Gallery 3 Album Up! (Under Construction and only 2 main albums are public)
http://www.buzzardsroost.us/gallery3

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-04-29 14:57
Quote:
Maybe something is failing inside of is_photo() function trying to check out the descendant?

Perhaps, but I can't replicate it and no-none else has reported it

What this code is trying to do is count the views on the photos in the current album and its children, rather than just the views of the album, as the info module does. If you care less about this and want the rest of the module, it wouldn't be hard to revert to the original version of views, or just delete views.

But I'd really like to know what is triggering this.

U-G

 
pinn8

Joined: 2009-02-19
Posts: 74
Posted: Sat, 2011-04-30 01:33

I exported the content of my "items" table and reviewed it detail in Excel. I don't see anything strange about the affected albums. Here are a few things I checked:
- All of the items in my database are either photos or albums.
- They all have valid values for view count.
- The "parent_id" values for items in these albums look right.
- Some of the descriptions contain characters like apostrophes or commas, however I have other albums/photos that work fine with these characters. I also tried removing these characters from the descriptions, but the problem did not go away.

One curious thing I found is that my "Colorado" album shows the problem differently. When I open this album using hte unmodified about_this_album module, one of the child albums comes back, but there are supposed to be 6.

What

 
Stan T

Joined: 2011-04-27
Posts: 52
Posted: Sat, 2011-07-02 16:17

Hi,
I am at 3.02 and using GD theme. When I am in Maintenance mode and add photos and edit photo, the views count has gone up by my views. Should this be happening?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-07-02 16:42

I have not used this module or the GD theme but this:
http://codex.gallery2.org/Gallery3:Modules:stop_owner_counts
might help.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Stan T

Joined: 2011-04-27
Posts: 52
Posted: Sat, 2011-07-02 19:39

Thanks Dave, but I have that installed.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2011-07-08 17:44

I think this happens because GD preloads the next image, and the stop owner counts module doesn't / can't deal with preloading. I have the same problem and this is the only possible reason that I can identify.

 
alargule

Joined: 2010-01-09
Posts: 13
Posted: Mon, 2011-07-25 20:44
undagiga wrote:
Perhaps, but I can't replicate it and no-none else has reported it

Same issue here, occurring at only one album. Seems to be this one, although I have the sneaking suspicion that it has something to do with the child albums/items.

Strange thing is, as soon as I move this to the root album, the root album displays just fine. But as soon as I move it to another parent album that's NOT the root album, that parent album won't show.