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 4 5 ... 10   Go Down

Author Topic: EnlargeIt! AJAX GUI for CPG 1.5.x  (Read 122341 times)

0 Members and 1 Guest are viewing this topic.

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
EnlargeIt! AJAX GUI for CPG 1.5.x
« on: January 05, 2009, 01:19:00 am »

What's this?
This plugin replaces the intermediate page with an AJAX gui that is widely configurable. EnlargeIt! turns the whole intermediate page into a pop-up-like window. It provides one of the fastest possible ways to browse a picture gallery.

This plugin works fine with any graphical web browser (Firefox 1.5 and higher, IE 5.0 and higher, Opera 8 and higher, Safari 3 and higher, Konqueror 3.5 and higher, Google Chrome ...), so you won't lose any visitors because of compatibility issues. Users without a Javascript-capable browser or who have deactivated scripting in their browser can use the gallery as if EnlargeIt! wasn't there at all. The whole plugin including the Javascript stuff is licensed under the GPL.

Features
* buttons for picture info, full size image, add to favourites, download, histogram
* navigation and close buttons
* navigation with arrow keys or mouse wheel (mouse wheel only with Mozilla & IE)
* seven different animation types
* chose animation speed and steps
* select border size, color and shadow
* centering and screen darkening (lightbox alike)
* enlarge to intermediate size or full size pics
* doesn't blow up your page size - only 24 Kbyte of javascript and 1 Kbyte of CSS is added
* support for flash files (SWF)
* support for playback of *.flv files - simply upload them to your CPG and they will play (filetype: *.flv)
* support for playback of *.divx files via DivX Web Player (http://labs.divx.com/WebPlayer) (filteype: *.divx)
* you can configure virtually everything on the config page - though it's not mandatory ;)

Demo gallery
http://bilder.timos-welt.de

Best practices
  • The more effect stuff you activate, the slower the animation will be on very old/slow computers. Turning off shadow, textured border and darkening will improve performance on these computers - it's up to you if you still like to be considerate of Pentium II and earlier...
  • Drag&drop, meaning sorting the enlarged pictures on the screen, only makes sense if you don't use the darkening feature. If you do use it, the visitor can only enlarge one pic at a time - not much to sort IMO ;)

Install
1. Copy folder enlargeit to your plugins folder.
2. Install via plugin manager. Configure with new admin button EnlargeIt!
3. If you update from a previous version, make sure to always completely uninstall the old version before installing the new one, and empty your browser cache afterwards.

Uninstall
1. Uninstall via plugin manager.

If it doesn't work
  • Check if the visitor has the right to access enlargeit.js (http://path.to.your.gallery/plugins/enlargeit/js/enlargeit.js) - the whole folder must be accessable via web by the visitors, because it contains the javascript and graphic files.
  • If the current version of this plugin doesn't work for you, you can find older versions here.
  • If you use a highly modded theme or a theme that doesn't provide valid HTML/XHTML, this plugin probably won't work. I can live with that, and you must! ;)

Credits
This plugin uses EnlargeIt! technology - http://enlargeit.timos-welt.de/
This plugin uses some icons from the free icon set 'Silk' - http://www.famfamfam.com/lab/icons/silk/
This plugin uses free FLV player by rphMedia - http://forum.coppermine-gallery.net/index.php/topic,43180.0.html
This plugin uses open source FLV player OSFLV - http://www.osflv.com/
Parts of this plugin are based on various MODs and plugins from the CPG forum by users Nibbler, Sami, rphMedia and others.

SVN:
https://coppermine.svn.sourceforge.net/svnroot/coppermine/branches/cpg1.5.x/plugins/enlargeit/

Download latest SVN snapshot:
http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/enlargeit.tar.gz?view=tar

Please don't send any PMs to me regarding this plugin; reply to this thread instead. Thanks!

regards  ;)
Timo

Download:
Download from repository at sourceforge.net: http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_enlargeit_v1.15.zip/download
« Last Edit: February 20, 2011, 11:52:30 am by François Keller »
Logged

Nibbler

  • Guest
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #1 on: January 06, 2009, 03:30:29 pm »

Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #2 on: January 06, 2009, 11:13:08 pm »

I have found that RegEx filtering using the "page_html" hook can be very CPU-intensive on large thumbnail pages.  Pages either time-out or load very slowly, or in extreme cases, the web host shuts down your site due to excessive CPU load (this happened to a colleague's site).

I started looking at EnlargeIt to see how to use better plugin hooks - either current ones or ones to create - that will avoid filtering the whole page using "page_html".

If you have time, Timo, please suggest new plugin hooks if necessary for this plugin or any of your others to avoid this heavy filtering.  The dev team agreed on the Dev Board to allow the addition of new plugin hooks during the alpha phase of 1.5.  This will hopefully encourage plugin authors who are porting existing plugins to 1.5 to suggest new plugin hooks that are more efficient or just more useful.
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #3 on: January 07, 2009, 01:28:47 am »

I'll have a look into it.
Logged

SaWey

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1119
    • SaWey.be
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #4 on: January 07, 2009, 08:37:00 am »

If you're having problems finding your way around the plugin API, don't hesitate to ask us
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #5 on: January 07, 2009, 02:23:30 pm »

If you're having problems finding your way around the plugin API, don't hesitate to ask us

It's not a plugin hook, but here's what I need to make the plugin very simple: EnlargeIt! modifies $template_thumbnail_view.

There's some variables/placeholders in there, e. g. {THUMB} or {CAPTION}.

I could remove nearly all of the regular expression stuff and the complete page_html filter, if six additional placeholders would be interpreted correctly for $template_thumbnail_view:
{PID} - The picture ID ($CURRENT_PIC_DATA['pid'])
{TITLE} - The picture title ($CURRENT_PIC_DATA['title'])
{PWIDTH} - The picture width ($CURRENT_PIC_DATA['pwidth'])
{PHEIGHT} - The picture width ($CURRENT_PIC_DATA['pheight'])
{FILEPATH} - The picture path ($CURRENT_PIC_DATA['filepath'])
{FILENAME} - The picture filename ($CURRENT_PIC_DATA['filename'])

Is it possible to teach the interpreter of $template_thumbnail_view these six variables?

regards
Timo

Edit: Forgot PWIDTH and PHEIGHT - they're neccassary for videos and flash files. Added filepath and filename.
« Last Edit: January 07, 2009, 02:36:24 pm by Timos-Welt »
Logged

SaWey

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1119
    • SaWey.be
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #6 on: January 07, 2009, 03:40:20 pm »

You might do this yourself, it is possible to override a theme function by just defining it in your plugin, just like you did with the template.
Have a look at this if you don't get what I mean: usergroups_alphatabs plugin (line 41)
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #7 on: January 07, 2009, 10:56:08 pm »

Overriding a theme function is a bad idea.  It means that users have to modify all their themes they want to use/have available for users to conform to the plugin's requirements.

@Joachim: Can these tags be added to themes.inc.php and the sample theme (and all core themes that override the relevant function) during this alpha phase?  It can be written so that the current tags like {THUMB} are still processed so this doesn't force theme designers who are porting themes to use the new tags.

I think that it's very important to allow plugin and theme authors to avoid filtering final HTML, so adding these tags would be extremely helpful.

Optimizing plugins & themes, I think, is a good thing to do during the alpha phase.  Is this acceptable if the changes are minor changes like these?
Logged

SaWey

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1119
    • SaWey.be
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #8 on: January 07, 2009, 11:30:50 pm »

I think it is the same as overwriting a theme template, like he does in his plugin, which is the reason I mentioned it.
Of cource it is best to avoid overwriting.

Could you clarify some more where you would place those tags?
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #9 on: January 07, 2009, 11:47:17 pm »

I think it is the same as overwriting a theme template, like he does in his plugin, which is the reason I mentioned it.
Overwriting any theme variables or functions in a plugin is a bad idea.  Unless I'm mistaken, we should strongly discourage plugin authors from doing so, because this makes the plugin difficult to use with many themes unless you make manual changes.   Plugins and themes should respect each other and not replace each other's code.

Could you clarify some more where you would place those tags?
The tags go into theme_display_thumbnails (with added array keys in display_thumbnails).  I've made the changes on my testbed and can commit them if it's OK to do so.  One alternative to adding these tags to the core is to add a plugin hook instead that allows a plugin (like EnlargeIt) to add these tags itself.  This might be preferred if adding more tags to a str_replace (from template_eval) is considered too much of a performance hit.  The new plugin hook would go into themes.inc.php, the sample theme, and other core themes as needed.  So new theme authors would have this plugin hook in the theme function.  Theme authors converting 1.4 themes would need documentation about adding this plugin hook, although it would be best as a general rule to tell theme authors to look at all functions and variables they overwrite to look for other changes in 1.5.
Logged

SaWey

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1119
    • SaWey.be
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #10 on: January 08, 2009, 12:13:14 am »

I prefer the plugin hook over the tags, no need to have those variables there for most people.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #11 on: January 08, 2009, 03:43:53 am »

I ran into a problem with implementing the plugin hook suggestion.  The problem is detailed here.

I have it running correctly now, with the changes to the Plugin API that I proposed in that thread.  Once that thread is resolved, I'll commit a plugin hook that will do what Timo wants and post a sample plugin here to show how to do so.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #12 on: January 08, 2009, 06:24:10 am »

I was misguided in my Plugin API problem (linked above), and so I reconsidered the plugin hook discussed here.

I committed the new plugin hook so it's ready to use.

Attached is a sample plugin showing how to use the new plugin hook.  It overrides $template_thumbnail_view since that's the simplest right now.  Looking through the core themes, no theme overrides the default (except the sample one of course).

Oh, the new hook is a filter hook named 'theme_display_thumbnails_params' and filters $params from theme_display_thumbnails().

edit: A link to the documentation with an example is here.

« Last Edit: January 08, 2009, 08:35:46 am by Paver »
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #13 on: January 08, 2009, 09:24:03 am »

Absolutely great, thanks. I will do an adapted EnlargeIt! version to try it out.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Paul Van Rompay
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #14 on: January 08, 2009, 10:07:03 am »

A few notes (which will eventually make it into the plugin documentation as guidelines for all plugin authors):

* For plugin configuration, please use a button on the plugin manager page instead of one on the admin toolbar.  The admin toolbar quickly gets filled up when using many plugins.  You can use the "extra_info" in configuration.php to include both a configuration button and a support button like this (I also included a modification for $install_info for EnlargeIt! to note the new location of the configuration button):
Code: [Select]
$install_info = "You can configure the plugin after installation, use the button on the plugin manager. "
    . "If you want ImageFlow or Slider plugins to use EnlargeIt!, install them together with this plugin and switch the settings on their config pages.";
$extra_info = '<span class="admin_menu"><a href="index.php?file=enlargeit/plugin_config" title="Configure EnlargeIt!">EnlargeIt! Configuration</a></span> '
    . '<span class="admin_menu"><a href="http://forum.coppermine-gallery.net/index.php/topic,57424.0.html" rel="external" title="EnlargeIt! Support">EnlargeIt! Support</a></span>'
    . '<p>This plugin is currently an alpha version. Not all features will work, especially the AJAX parts (these will be completed after CPG 1.5.x is released). Thanks for understanding.</p>';
Some plugins' main function might require a button on the admin toolbar, but most plugins should just use a button on the plugin manager page.

* You can remove the plugin manager button from the title of your configuration panel.  For 1.4, this was a quick way to return to the plugin manager, but now 1.5 has a plugin manager button on the admin toolbar.

* $lang_continue is no longer a language variable.  You can use $lang_common['continue'] instead.  In your plugin_config.php, here are the relevant lines with a link back to the plugin manager page (which makes sense to me):
Code: [Select]
  // success note to user
  pageheader($lang_enlargeit['display_name']);
  msg_box($lang_enlargeit['display_name'], $lang_enlargeit['update_success'], $lang_common['continue'], 'pluginmgr.php');
  pagefooter();
  exit();
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: EnlargeIt! AJAX GUI for CPG 1.5.x
« Reply #15 on: January 11, 2009, 12:17:20 pm »

Just uploaded v0.3 - this one avoids regular expressions completely using the new plugin hook, though it may not yet work with all thumbnail settings from the config page. Thanks for your hints.

And yes: It's faster.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: Monitor Calibration Bar for cpg1.5.x
« Reply #16 on: March 27, 2009, 02:14:12 pm »

Problem fixed with 1.2. Config page looks really dummy proof now, nice job!
Would be nice if this could link with EnlargeIt.
I must admit that I'm a bit reluctant to look into enlargeIt: it really looks very promising, but I just can't understand why it needs the extra file to go into the root, making it not a genuine plugin that way.

[Edit GauGau]
Split this posting and the next few ones from the thread that deals with the monitor calibration bar plugin and merged them with the thread that deals with enlargeIt.
« Last Edit: March 27, 2009, 08:29:19 pm by Joachim Müller »
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Monitor Calibration Bar for cpg1.5.x
« Reply #17 on: March 27, 2009, 02:18:15 pm »

Not for you to worry about but for Timos (should he choose to use this or a other method of calibration in EnlargeIt).
Logged

Timos-Welt

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 800
    • Timos-Welt
Re: Monitor Calibration Bar for cpg1.5.x
« Reply #18 on: March 27, 2009, 04:05:17 pm »

I must admit that I'm a bit reluctant to look into enlargeIt: it really looks very promising, but I just can't understand why it needs the extra file to go into the root, making it not a genuine plugin that way.

You're certainly not dumb, so I don't need to tell you what changes would be neccessary to certain core files to make EnlargeIt! a 'genuine' plugin. You already know it - simply give the core files a 'snippet' mode.

http://cpg/displayimage.php?pid=XX&snippet=info
=> Pic info snippet
http://cpg/displayimage.php?pid=XX&snippet=vote
=> Voting snippet
http://cpg/displayimage.php?pid=XX&snippet=comment
=> Comment snippet
http://cpg/ecard.php?pid=XX&snippet=yes
=> Ecard snippet

The question is: Do you actually want that? The core files will be more complicated in this case (the switch would lead to certain different CSS classes to be used which have to be part of the themes, links from snippet to snippet must be handled in a different way than now...), and EnlargeIt! would have to be an integral part of the whole project. The continuing friendly indifference of you as project leader and the whole dev team in the last 10 months gave me a completely different impression: Nice gimmick, but not interested. As long as this is the case, it's not a very good idea from your side to put the existence of the additional root files into question.
Logged

Nibbler

  • Guest
Re: Monitor Calibration Bar for cpg1.5.x
« Reply #19 on: March 27, 2009, 04:49:15 pm »

It's much simpler than that.

You just move the root files into the plugin's folder, and then change the urls you use from

Code: [Select]
enl_file.php
to

Code: [Select]
index.php?file=enlargeit/enl_file
Then Coppermine will include() the file from the plugin's folder. Much neater and much easier for the user.
Logged
Pages: [1] 2 3 4 5 ... 10   Go Up
 

Page created in 0.07 seconds with 21 queries.