Pages (2): 1 2   
Member
Member
Sabyre   16-08-2010, 22:25
#1

I would like to be able to call the album tags for each image, instead of each image having individual tags.

For example: When creating an album, tags would be defined for that album and those tags would be displayed for every image within that album.

Member
Member
kagutsuchi   16-08-2010, 23:22
#2

Depending on how you want to output the tags, you could use the tags_from_album plugin. You could also simply use something such as $_zp_current_album->getTags() and output them accordingly. Or, for a different approach, you could copy over the album's tags to a new image via the new_image filter. The former methods are probably easier, however.

Member
Member
Sabyre   16-08-2010, 23:43
#3

I tried using the tags_from_album plugin but I am having a hard time getting it to work ... not sure exactly what to put in my image.php file....

Member
Member
sbillard   17-08-2010, 00:39
#4

If you are intending these tags to be used for such things as searching there is not currently a solution. We have on our list a bulk-edit type feature for setting tags, but implementation has not begun on it.

Member
Member
Sabyre   17-08-2010, 02:14
#5

Nope, just want to be able to define tags for an album and then have those same tags display with each individual image within that album.

I enabled the tags_from_album plugin and placed the following code on my image.php, but all I got was SQL errors.

[code]

[/code]

Member
Member
sbillard   17-08-2010, 03:09
#6

Let us know the SQL errors. Off hand that call looks correct.

Member
Member
Sabyre   17-08-2010, 03:14
#7

Zenphoto encountered an error
MySQL Query ( SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM zp_obj_to_tag WHERE tagid = t.id AND o.type = 'albums') as count zp_obj_to_tagas o,zp_tagsas t WHERE (o.objectid =10 AND o.tagid = t.id AND o.type = 'albums') ORDER by t.name ) failed. MySQL returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'zp_obj_to_tagas o,zp_tagsas t WHERE (o.objectid =10 AND o.tagid = t.id AND o' at line 1

Administrator
Administrator
acrylian   17-08-2010, 08:44
#8

Actually kagutsuchi's way is a good ay for getting the direct tags of the album you are in. You will of course write a foreach loop to show them as a list.

Regarding your function call `. Try setting thealbumsparameter as"albums"` (in quotes). Is the album "sasha" a toplevel album? If not you have to write "toplevel/sublevel(...)".

Maybe you could also tell what MySQL version you are running. It seems that one value is empty on your sql but I don't know right now why that can happen.

Member
Member
Sabyre   17-08-2010, 13:03
#9

MySQL 5.1.39

"sasha" is the name of the toplevel album folder.

I tried putting albums in quotes... Same error

I tried putting "toplevel(sasha)".... same error.

Member
Member
sbillard   17-08-2010, 16:16
#10

There is an error in the function code which is resulting in the string zp_tagsas where it should read zp_tags AS. (Note the missing space.) I will get a correction made to this in tonight's nightly build.

Thank you for posting the SQL error. Could not have seen this without that hint.

Administrator
Administrator
acrylian   17-08-2010, 16:55
#11

Ah, now I see it as well...

Member
Member
Sabyre   17-08-2010, 18:22
#12

So where do I need to adjust the code? Which file? im not seeing it in tags_from_album.php

Member
Member
Member
Sabyre   17-08-2010, 18:36
#14

well, I put the spaces in around line 69 in tags_from_album.php and then there is a similar line below it it I adjusted that as well.

Here is the adjustment.

[code]
$tags = query_full_array("SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM ". prefix('obj_to_tag'). " WHERE tagid = t.id AND type = 'images') as count FROM ". prefix('obj_to_tag'). " as o,". prefix('tags'). " as t".$tagWhere." ORDER by t.name");
[/code]

I still get the same error.

Member
Member
Sabyre   17-08-2010, 18:42
#15

Just looked at your change and adjusted mine ... still doesnt work

Member
Member
Sabyre   17-08-2010, 19:02
#16

Got it ... line 81 is missing a FROM...

should be...

[code]
$tags = query_full_array("SELECT DISTINCT t.name, t.id, (SELECT DISTINCT COUNT(*) FROM ". prefix('obj_to_tag'). " WHERE tagid = t.id AND o.type = 'albums') AS count FROM ". prefix('obj_to_tag'). "AS o, " . prefix('tags'). " AS t " .$tagWhere. " ORDER by t.name");
[/code]

Administrator
Administrator
acrylian   17-08-2010, 19:21
#17

Indeed! Good find! Fix is in the svn.

(Btw, we don't use bbcode on the forum, just use backticks)

Member
Member
Sabyre   17-08-2010, 19:34
#18

ok, this is what im using on my image.php.... I'm looking for a way for it to return the current album and I thought that this would do it. However it returning all tags from all albums instead.

Any ideas?

Member
Member
Sabyre   17-08-2010, 19:34
#19

and what are backticks?

Member
Member
Sabyre   17-08-2010, 19:41
#20

again.... got it ...

Had the quotes wrong.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.