Error with tag cloud.

Hi
Can anyone help? I am using Zenphoto version 1.4.6 & php 5.4

I would like to have a tag cloud that displays all tags on the site, whether they be on a page, news, image or album.
So that an album can use the same tag as a news item.
Is this possible ?

I am using the plugin tag_extras
I have tried
`

<?php printAllTags('','all'); ?>

and

<?php getAllTagsFromAlbum_multi_unique(); ?>

`
I am getting the following errors. `

Warning: Invalid argument supplied for foreach() in /home/ch/public_html/dev/zp-core/zp-extensions/tag_extras.php on line 290

Warning: array_unique() expects parameter 1 to be array, null given in /home/chalkwor/public_html/dev/zp-core/zp-extensions/tag_extras.php on line 292

Warning: Invalid argument supplied for foreach() in /home/ch/public_html/dev/zp-core/zp-extensions/tag_extras.php on line 293

`
Any ideas on what I am doing wrong or is this a bug?

Comments

  • acrylian Administrator, Developer
    No bug, you are using it wrong ;-) `printAllTags()` requries an array of the tags to display as generated by the `getAllTagsFromXXX` functions (as written on the documentation). It is the base function for the `printAllTagsFromXXX` functions.
    `getAllTagsFromAlbum_multi_unique()` is not meant to be used standalone at all.

    This plugin is meant to get only the tags from Zenpage news or pages or a specific album plus optionally its subalbums

    If you want all tags as a cloud regardless from where use this one: `http://www.zenphoto.org/documentation/functions/_template-functions.php.html#functionprintAllTagsAs`

    That function is also the example on how to read the user guide:
    http://www.zenphoto.org/news/how-to-read-the-zenphoto-functions-guide
  • Thanks Acrylian.
    I now have a list with

    <?php echo printAllTagsAs('cloud','','',TRUE,TRUE,3,5,1,50,2,0.8); ?>
    This prints a list rather than a cloud but that may be something to do with my theme. I am sure I can work it out.
    thanks for your help
    e
  • acrylian Administrator, Developer
    Yes, it does print a list but the function does not have default css so the theme has to control it. You can look at the standard themes' css. But you should see different sized tag names depending on the number of usage as those are added inline.
  • MarkRH Member
    Yeah, I just got through playing around with the tag cloud on my gallery that I'm working on yesterday or the day before. In the Garland theme that mine is based on, I noticed that it had a "tags" CSS class. So, in that function call, I would use "tags" as the second parameter:
    `printAllTagsAs('cloud' , 'tags', NULL, FALSE, TRUE, 2, 25, 2, NULL, 0.8);`

    I modified the CSS of the class to make it look more like what my current Gallery 3 tag cloud is doing.
Sign In or Register to comment.