Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3   Go Down

Author Topic: flf_flashcloud - Get a moving cloud with your image tags  (Read 21723 times)

0 Members and 1 Guest are viewing this topic.

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
flf_flashcloud - Get a moving cloud with your image tags
« on: February 09, 2010, 07:16:41 am »

Hi there,
today I'm releasing my next plugin for coppermine. Please give me feedback via this thread if you encounter any problems or have any suggestions.

To see the plugin at work please visit http://www.lounge-lizard.org/cms/

Regards, Florian



==============================================================================================================
What it does
=============================================================================================================

This plugin generates a web 2.0 style moving flash cloud of all the tags to the images insided your database.
The tags of all images are counted and weighed with an logarithmic algorithm to get a proper distribution
(tags that are counted more are given a bigger font etc.)
In total, there are up to 10 distinguished sizes (it's always up to your specific tag distribution). Play around
with the parameters in the configuration settings a bit to see the different effects (max size, min size, threshold
etc.) You can define a specific color for each of the 10 sizes. (Color 10 being the color for the biggest font, 1
for the smalles font). Additionally you can define one highlight color, when you hover over a tag.

Currently, there is only one big system-wide tag cloud from all your images in your library. Because of this,
I added a function to where you can define, whether you want to hide tags from private files, i.e. files
that are in a protected album.

If you have many images with many tags you will have thousands of items to cope with. The cloud will not be much use
then, so I added a function where you can set the minimum amount of images that must have the same tag, before the
tag is added to the cloud. Experiment with it. Start out with 2 if you have a lot of images and see how your cloud
looks.

Upon clicking of a file, the coppermine search function is triggered, so even if you click on a tag of an image
that you are normally not allowed to see, you won't see the image after that.

The tag cloud can be generated on demand (via the plugin manager) or updated any time a picture is uploaded.

To display the cloud, you have three ways to show the cloud
a) make use of the "main_page_layout" Coppermine setting
   Enter the value "flashcloud" along the string in the proper position to display the cloud. For example:
   breadcrumb/catlist/alblist/random,2/lastup,2/flashcloud
   will let you see the cloud listed as the last entry of your startpage.
b) You can reference in your own theme to a page, that only consists of the cloud page. Just call
   http://<yoursite><yourpathtocoppermine>/index.php?file=flf_flashcloud/testdrive
   For an example come visist www.lounge-lizard.org/cms/coppermine/index.php?file=flf_flashcloud/testdrive
c) Use the parameter to display the cloud on the Coppermine search-page. You can decided whether you want to
   display the cloud below or above the search text fields. Note: This feature requires a new hook that had not
   been implemented in the publicy release 1.5.2-code. Please upgrade to the latest Coppermine version from SVN,
   to have code revision 7225 or higher.

==============================================================================================================
Installation & Configuration
==============================================================================================================

Install plugin with COPPERMINE Plugin Manager.
Edit configuration before first running the tool!
Make sure, the file /plugins/flf_flashcloud/cloud_data.xml is writable by your webserver user. Depending on your
webserver setup change the rights to '0775' or '0777'. When you install with the plugin manager,
this step should not be necessary.


==============================================================================================================
Credits
==============================================================================================================

- The original tagCloud was taken from http://downloads.wordpress.org/plugin/wp-cumulus.zip, Autor: Roy Tanck
  http://www.roytanck.com. The original flash source file is packed with this plugin as required by the author.
- The basic font size distribution algorithm was found on
  http://www.php.de/php-fortgeschrittene/44928-tag-cloud-algorithmus-fuer-schriftgroessye.html and created by
  http://simbo.de

==============================================================================================================
Things on my To-Do-List
==============================================================================================================
- Think of a way how to generate user-specific clouds including tags for images only the specific user may see
« Last Edit: September 28, 2010, 06:44:42 am by loungelizard »
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #1 on: February 09, 2010, 08:48:36 am »

Absolutely great, I already loved that one when visiting your homepage. It would even be nicer to optionally replace the keyword list on search.php with your flash cloud. Adding a plugin hook should be no problem (currently keyword.inc.php uses echo to print out the keywords directly, but that shouldn't be too difficult to change). Do you think you could add this functionality?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #2 on: February 09, 2010, 10:43:07 am »

Adding a plugin hook should be no problem (currently keyword.inc.php uses echo to print out the keywords directly, but that shouldn't be too difficult to change)
That's an easy task ;)
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1498
  • aka 'i-imagine'
    • Home Page
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #3 on: February 09, 2010, 02:46:24 pm »

Very, very cool. It's much better than the monochrome version (jquery) that I was working on. Thanks for saving me the work!

I did find one typo. in configure.php resulting in:
Code: [Select]
Fatal error: require_once() [function.require]: Failed opening required './plugins/flf_histotag/init.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a300d29/public_html/pics/plugins/flf_flashcloud/configure.php  on line 16

However, it was easily fixed with:
Code: [Select]
require_once './plugins/flf_flashcloud/init.inc.php';
Nice work!

[edited for my own typo....]
« Last Edit: February 09, 2010, 03:12:54 pm by Joe Carver »
Logged

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #4 on: February 09, 2010, 06:36:02 pm »

Absolutely great, I already loved that one when visiting your homepage. It would even be nicer to optionally replace the keyword list on search.php with your flash cloud. Adding a plugin hook should be no problem (currently keyword.inc.php uses echo to print out the keywords directly, but that shouldn't be too difficult to change). Do you think you could add this functionality?

That's a great idea. I'll look into adding the hook and post any news soon.

Cheers, Florian
Logged

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #5 on: February 09, 2010, 06:39:00 pm »

Very, very cool. It's much better than the monochrome version (jquery) that I was working on. Thanks for saving me the work!

I did find one typo. in configure.php resulting in:
Code: [Select]
Fatal error: require_once() [function.require]: Failed opening required './plugins/flf_histotag/init.inc.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a300d29/public_html/pics/plugins/flf_flashcloud/configure.php  on line 16
Thanks. I'll repair that in the next version. That's the problem of copying off other (in this case my own ;-)) plugins. I did find a similar one in the flf_histotag where I still reference to a Javascript in the thumb_rotate plugin. I never find them in my testbed nor on my live systems, cause they always have the same software base.

Cheers, Florian
Logged

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #6 on: February 09, 2010, 10:02:39 pm »

I added the plugin hook as suggested. In search.php right after

Code: [Select]
if ($CONFIG['clickable_keyword_search'] != 0) {
    include('include/keyword.inc.php');
}

I added the following code:

Code: [Select]
if ($CONFIG['clickable_keyword_search'] != 0) {
    include('include/keyword.inc.php');
}
$text = CPGPluginAPI::filter('searchtag_include', $text);
echo $text;

Works perfectly for me with my local testbed. What's the process of getting a hook like that officially included into the core package?

I'll include a parameter in my plugin configuration to decide, whether to actually use the hook.

Cheers, Florian

Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #7 on: February 10, 2010, 09:39:52 am »

What's the process of getting a hook like that officially included into the core package?
We're currently in the process ;) I'll check and add the hook soon.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #8 on: February 10, 2010, 09:47:03 am »

If we add the hook after the keyword include, the keywords appear above the search form.

Can you use the hook if we add it before the keyword include?
Code: [Select]
$text = CPGPluginAPI::filter('search_form', $text);
echo $text;

if ($CONFIG['clickable_keyword_search'] != 0) {
    include('include/keyword.inc.php');
}
Logged

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #9 on: February 10, 2010, 11:12:13 pm »

Hi Andre,
I tried using it right after the "pageheader" as well as before the keyword include: it both worked fine.

Right after pageheader lets the cloud be the first on the searchpage, right before the include lets the search fields first and then the cloud.

Personally I like the hook right after the pageheader the best.

Regards, Florian
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #10 on: February 11, 2010, 09:09:13 am »

I'm not sure if you know how the plugin filter works.

The line
Code: [Select]
$text = CPGPluginAPI::filter('search_form', $text);passes the variable $text (which is the whole search form excluding the keywords) to your plugin. In your codebase.php you can do with that content what you want.

You can add your cloud above the search form
Code: [Select]
return $cloud.$text;or below the search form
Code: [Select]
return $text.$cloud;with the same hook. So you can introduce a config variable (like Display cloud in search form?: No / top / bottom).


I'll add the hook now.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #11 on: February 11, 2010, 09:41:49 am »

Added hook in r7225.
Logged

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #12 on: February 11, 2010, 09:28:52 pm »

Hi André,
thanks for your quick response. You are right - I didn't think about the opportunity to change the return values from my plugin. I added the hook you supplied and updated my plugin.
Please see first post for download link.
I did have some problems on my live system with the changes though, it messed with my theme layout on my search.php. It didn't do that on my local testbed which uses a different theme. Maybe someone with a current Coppermine version can confirm it's working correctly. I still have to look into the potential problem on my live system.

Cheers, Florian
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #13 on: February 11, 2010, 10:39:59 pm »

I did have some problems on my live system with the changes though, it messed with my theme layout on my search.php.
I added a new parameter to the functions starttable and endtable. Maybe it something to do with that (hard to say without a link :)).
Logged

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #14 on: February 12, 2010, 06:13:55 am »

it's on www.lounge-lizard.org/cms/coppermine/search.php. I'll look into it some more this weekend.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #15 on: February 12, 2010, 09:10:23 am »

Logged

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #16 on: February 12, 2010, 08:11:50 pm »

Got it fixed. Updated Version 1.1. Thanks.
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1498
  • aka 'i-imagine'
    • Home Page
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #17 on: February 17, 2010, 11:51:04 pm »

V1.1 would not install....

Quote
Fatal error: require_once() [function.require]: Failed opening required './plugins/flf_flashcloud/include/flashcloud_include.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/a300d29/public_html/pics/plugins/flf_flashcloud/init.inc.php  on line 13

It then locked up plugin manager - I needed to manually delete via ftp to restore cpg.
Confirmed with latest cpg (downloaded from svn < 30 minutes prior to this post)

loungelizard

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 63
    • lounge-lizard.org
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #18 on: February 20, 2010, 12:48:09 pm »

V1.1 would not install....

It then locked up plugin manager - I needed to manually delete via ftp to restore cpg.
Confirmed with latest cpg (downloaded from svn < 30 minutes prior to this post)

I don't really get it. I downloaded the package i uploaded here, deleted everything locally on my testbed, tried to install it with the plugin manager: got the same result you did. Since then I'm unable to replicate. (Doing the same things, uninstalling, deleting all references, uploading the same package: It works fine. The real bugger is, that the way I use the init.inc is identical to other plugins and they reference their includes the same way.

Have you tried manually copying the files to your coppermine and installing then only? Did you have the same result?

I'll keep looking, but frankly I don't yet have a clue why it's doing this.

Cheers, Florian
Logged

Joe Carver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1498
  • aka 'i-imagine'
    • Home Page
Re: flf_flashcloud - Get a moving cloud with your image tags
« Reply #19 on: February 20, 2010, 01:39:52 pm »

I had no problem with the previous version. I will make another try and edit this reply with my result.
Since I am still "cleaning up" after changing hosts yesterday it might take me a little while.

     +++++
Florian, I wish I could offer you completely clear answers, but what I have found seems to deepen the mysteries.

Yes, doing a manual (via ftp) upload/installation returned no errors. But unfortunately the plugin did not function - I could not get the cloud to display. This is with no other plugins installed. Turning on debug returned a couple/few errors, both in User and Admin modes.

But I am not too sure the previous error (install) is 100% the fault of your plugin. If I have more time I will try to confirm this - if I try to Delete any uploaded plugin......it will not delete! The plugins remain on the list! So therefore it might have been a problem when I uploaded the zip and it tried to unzip over a folder/plugin that was still in the Plugin folder. I have tried to delete other plugins within the same folder (all at 755 permissions)
and they also are "sticky" and will not delete.

Please note: I am still not 100% confident in this "live server" testbed. Also, I checked your demo link in the first thread and got no cloud there either.

My new host is now running:
 Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.11
X-Powered-By: PHP/5.2.11

(And as a side note I personally would not completely trust a local testbed and because my best talent is for errors I always test with at least two different browsers with both Admin and user mode + Debug on)

If I learn more I will post it here. - Good Luck!

Cheers
Joe
« Last Edit: February 20, 2010, 03:06:47 pm by Joe Carver »
Logged
Pages: [1] 2 3   Go Up
 

Page created in 0.039 seconds with 20 queries.