forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: Αndré on July 15, 2009, 03:05:42 pm

Title: Flickr style image annotations for cpg1.5.x
Post by: Αndré on July 15, 2009, 03:05:42 pm
Add text annotations to your images like on Flickr. Pretty cool.

This plugin is a port from the cpg1.4.x plugin 'Flickr style image annotations (http://forum.coppermine-gallery.net/index.php/topic,41715.0.html)' created by Nibbler.


I fixed some bugs and added a new meta album 'lastnotes'. There is also a button which deletes orphaned entries (the annotations won't be deleted when you delete files).

Download: http://sourceforge.net/projects/coppermine/files/Plugins/1.5.x/cpg1.5.x_plugin_annotate_v2.11.zip/download
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Joachim Müller on December 18, 2009, 09:44:09 am
Subversion access
This plugin resides in the subversion repository as well. Advanced users who know their way around in subversion are welcome and encouraged to take a look at the most recent version of this plugin that is available through SVN access exclusively. Please understand though that the usage of the subversion repository itself is beyond the scope of support on the coppermine support board - if you have questions how to use subversion, take a look at the documentation that comes with cpg1.5.x, section "Subversion (http://documentation.coppermine-gallery.net/en/dev_subversion.htm)" for a start. The "official" releases of this plugin often lag behind in version count and features behind what is in the subversion repository. For subversion web access try http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/annotate/. To check out using your local subversion client, use https://coppermine.svn.sourceforge.net/svnroot/coppermine/branches/cpg1.5.x/plugins/annotate/.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Joachim Müller on December 18, 2009, 10:16:51 am
Coder / Contributor discussion only: Code suggestion discussion in a separate thread "annotate plugin for cpg1.5.x: use less queries (http://forum.coppermine-gallery.net/index.php/topic,62908.0.html)" (not accessible for all).
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on January 05, 2010, 11:29:17 am
Version 2.4 fixes a bug (typo) that prevented adding new annotations.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on March 12, 2010, 12:00:50 pm
Version 2.6 takes care of the new meta album validation (http://forum.coppermine-gallery.net/index.php/topic,63977.msg318086.html#msg318086).
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on March 12, 2010, 02:10:44 pm
Version 2.7 visually integrates to the new file menu (buttonlist).
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: gomanski on March 17, 2010, 01:06:55 am
I know it was talked about briefly in the 1.4x version thread; but is there any (simple) way to add annotations to the gallery-wide search?

I'd love to use this to tag family photo albums, then search for those people in photos.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on March 17, 2010, 08:03:56 am
Currently there is no real search. But there is a meta album 'shownotes', which can be accessed from every annotation.

I created a custom search form, which fits the needs of my personal gallery. It contains a list of all different annotations and you can search for pictures where you tagged person 1 AND person 2. I'm not sure if it's possible to extend the built-in in that way. Alternatively the custom search form could be added to this plugin if desired.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 13, 2010, 04:21:18 pm
Is it possible to add the option to allow user by group permission to add/edit/delete any image in the gallery instead of just their own?
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 13, 2010, 06:54:28 pm
Isn't this option already built-in?
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 13, 2010, 07:19:25 pm
Users only have the option to adjust their own posts. It would be nice to allow a registered user to comment directly on someone else's images. I am sure that some boards would rather only allow the user the ability annotate on their own so it would be best to have an option in the permissions configuration screen to check off it that are allowed global or local permission. As admin I have the ability to add/edit/delete any annotations and that is what I would like all of my registered users to have too. Thank you for the time. Even a code hack at this time would be great if possible.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 13, 2010, 08:29:32 pm
As admin I have the ability to add/edit/delete any annotations and that is what I would like all of my registered users to have too.
That's already possible. Just set it accordingly on the plugin config page.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 13, 2010, 08:47:26 pm
I hate to disagree, but I disagree.  ;D

The settings are set identical for admin as registered users and I can add/edit/delete any images as admin, but registed users can only add/edit/delete from their own images. Feel free to test in my gallery I will set the global registration password to "test" for the next few hours and this is the gallery link http://www.granbycameraclub.com/gallery (http://www.granbycameraclub.com/gallery).
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 14, 2010, 10:17:48 am
Please provide a test account.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Joachim Müller on April 14, 2010, 10:21:04 am
We certainly won't go through registration just to be able to support you ::)
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 14, 2010, 02:31:17 pm
Is there a way that I can PM you a password? I would be happy to create a test account.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 14, 2010, 02:47:22 pm
No. The PM system has been disabled. Please post user name and password in this thread.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 14, 2010, 03:22:23 pm
username = test
password = test

Please change the password after you login so that it does not get flooded. Thanks!
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 14, 2010, 03:48:57 pm
I can confirm your issue and have tracked it down to r7306. I'll fix it and release a new version asap.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 14, 2010, 04:01:43 pm
Version 2.8 should fix your issue.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 14, 2010, 04:09:33 pm
Again it would be best to allow admin to assign global or local permissions to each group for that.

PS. I tested with IE7 and IE8 and it did not work for add, edit, or delete. Just an FYI if not tested yet.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 14, 2010, 04:26:22 pm
The test account doesn't work anymore. I've tested in on my local testbed and the buttons will be displayed for your own and pictures from other users. What exactly does not work for you?

A config setting could be added later, if your actual issue is fixed.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 14, 2010, 04:38:43 pm
I just tested with Firefox and it is working like "I" want it to. I think that other's would rather you have the option of only allowing annotating on the user submitted images. GREAT thank you to you for your time and VERY quick responses.

I deleted the test account because you never changed the password as I requested and it left our gallery open for spam attack. <-- Not meant to me mean at all, just a fact.

The issue with IE7 and IE8 are that you cannot see the annotations on the image or add/edit/delete them. The button for annotate is there, but does not do anything. I tested both IE7 and IE8 with both XP home and XP PRO. For now I can just tell my users if they want that function they need to use Firefox, but I thought that you would want to know about it and it would be great it Firefox was not required. Please note that I have not tested with other browsers, but these are the leaders so I only tested with them.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 14, 2010, 05:53:03 pm
IE issue should be fixed with version 2.9. Please confirm.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 14, 2010, 07:28:26 pm
Darn you Andre' .. If I could get the people that work for me to work as fast and good as you I would be a happy man. IE8 checks out fine now. Thank you!!!!
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 15, 2010, 06:09:16 pm
Here is just another suggestion. Could we give the user the option to turn off "allow annotations" for individual images or albums even? I would prefer the default to be allow equals yes and let them turn it off if needed.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 15, 2010, 06:11:19 pm
One minute later and another suggestion. Can we add a hyperlink like "Most viewed" and "Top rated" that would filter to just show annotated images in the gallery?
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 29, 2010, 06:48:20 pm
Can we add a hyperlink like "Most viewed" and "Top rated" that would filter to just show annotated images in the gallery?
Meta album 'lastnotes' already exists. I'll think about your other suggestions later.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: paintblr on April 29, 2010, 07:58:04 pm
So sorry. I do not see it in my gallery and I assume that I need to activate it to get it to show up. Any advice?
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on April 29, 2010, 09:28:36 pm
You have to add the link manually to your gallery. Currently there is no option to add it automatically to your gallery. Maybe it will be added later. You can access it here: http://www.granbycameraclub.com/gallery/thumbnails.php?album=lastnotes
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: taucher_0815 on June 03, 2010, 10:39:36 am
Have an issue installing this plugin on http://www.sk-foto.info with PHP4.
Quote
Parse error: syntax error, unexpected '(', expecting '}' in /var/www/SoMeThInG/html/coppermine/plugins/annotate/codebase.php  on line 83

installs fine with PHP5
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on June 03, 2010, 11:03:42 am
Attached updated plugin in initial post.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: taucher_0815 on June 03, 2010, 11:24:48 am
Installes well with PHP4.

But my be i am to stupid to annotate any of the pictures...

Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on June 03, 2010, 11:26:49 am
Please check the annotation permissions for your user group. You currently only have an (empty) list. You need to enable free text annotations in the first place to build the list and then switch back to e.g. list-only.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: taucher_0815 on June 03, 2010, 11:29:20 am
many thanks!

works now :)
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: willy2010 on November 01, 2010, 02:31:12 pm
Version 2.8 should fix your issue.

I've installed 2.10 version but I got the same problem: as administrator I see annotate button and annotations but as registered user I see nothing (neither buttons nor text!) My configuration as attachment...

can you help me?
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on November 01, 2010, 02:38:55 pm
Please post a link to your gallery and a test user (non-admin) account.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: willy2010 on November 01, 2010, 05:33:15 pm
Please post a link to your gallery and a test user (non-admin) account.
Sorry mate but I don't understand what you could check using a non admin account. You have to believe me ! :-)  Anyway, i had a look at the codebase.php module  and force "annotate" to all registered users in order they can annotate any picture, owned or not. Like Flicker, I think  these notes are very useful for commenting part of pictures. I did this changes

function annotate_get_level($what) {
    global $CONFIG, $cpg_udb;

   // Admin always have the highest permission
    if ($what == "permissions" && GALLERY_ADMIN_MODE) {
        return 3;
    }
    else
       Return 2;
  ----
  ----
 ----

and it seems to work fine because all users has its annotate button and are be able to leave annotations about any picture.  Only one question : returning 2 could be "dangerous" for the other annotations ? I've checked and doesn't seem but could be better you opinion !  ::) 

Beautiful tool !
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on November 01, 2010, 06:40:19 pm
Sorry, but I cannot support individual mods. Instead I'd like to figure out why the plugin doesn't work as expected for you.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: willy2010 on November 01, 2010, 06:53:07 pm
Sorry, but I cannot support individual mods. Instead I'd like to figure out why the plugin doesn't work as expected for you.

I told you Andre: As administrator I can make annotations everywhere but not as a registered user (only works on owned pictures). That was my question ! :-)  Thank you anyway.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on November 03, 2010, 12:38:25 pm
not as a registered user (only works on owned pictures)
Just tested. As regular user I can add annotations to pictures from other users (the admin in my case). If you don't want to post a link you're on your own.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: MISHA on November 11, 2010, 09:47:00 pm
russian
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Makc666 on November 12, 2010, 10:47:33 am
russian

Here is the full Russian translation of this plugin.
Based on MISHA.
A lot of changes by Makc666.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on November 12, 2010, 11:01:09 am
Thanks for your contributions. Added Russian language file in r8034.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: pftq on December 19, 2010, 02:05:35 pm
Upgrading from CPG 1.4.x

This might just be from my experience but I couldn't get the meta album working earlier as it was returning a critical error:

Code: [Select]
While executing query 'SELECT *, user_time AS msg_date
...

It turns out when upgrading from the cpg1.4.x version there was no user_time column so I had to add that manually to the database.  Just pointing this out incase other users have the same trouble.

On a side note, I added a preview of the annotation on the "Last annotations" page so it is similar to last comments.  It might be worthwhile to have this in the mod if you get a chance to implement it.  Example:
http://www.pftq.com/gallery/thumbnails.php?album=lastnotes

Some Suggested Fixes:
These were some changes I had implemented in my copy of the CPG 1.4.x version.
The below fixes the flickering boxes when the mouse moves over the picture.  Edit in lib/photonotes.js

Replace:
Code: [Select]
       this.container.DisableAllNotes();
        this.EnableNote();
with
Code: [Select]
       this.container.DisableAllNotes();
        //this.EnableNote(); **pftq // No need to flicker every hover

Replace:
Code: [Select]
    if(!this.container.editing && this.editable) /* nibbler */
    {
        this.ShowNoteText();
with
Code: [Select]
    if(!this.container.editing && this.editable) /* nibbler */
    {
        this.ShowNoteText();
        this.EnableNote(); /* pftq */ // Place here so only flicker when editing

Replace:
Code: [Select]
editable: true /* nibbler */  with
Code: [Select]
       highlighted: false,  /* pftq */
        editable: true /* nibbler */  

Replace:
Code: [Select]
this.HideNoteText();with
Code: [Select]
   this.HideNoteText();
    this.highlighted= false;  /* pftq */

Some other problems I've run into that I haven't been able to resolve:

When annotating, the buttons for "Save", "Cancel", etc all have "null" prepended so that they show up as "nullSave".

You can login as 'test' with password 'test' if you want to check on my gallery:
http://www.pftq.com/gallery/

I'm also unable to give regular members permission to annotate.  I think it might be due to the SMF bridge, and the solution posted by willy2010 on the last page seems to work, except I only added it for registered users as so:
Code: [Select]
if(USER_ID) return 2;
This might be related as well but I'm unable to view annotations from non-admin users (both admin and test account).  I'll update this thread if I figure out why that might be.  All user permissions are RWD, so I don't think that should be the issue.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: pftq on December 19, 2010, 03:44:34 pm
Yay, I've fixed the notes not showing for non-Admins.  It was indeed a bridging problem.  :)

For the codebase.php, find:
Code: [Select]
$sql = "SELECT n.*, u.user_name FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate n INNER JOIN {$CONFIG['TABLE_USERS']} u ON n.user_id = u.user_id WHERE n.pid = {$data['pid']}";
        $result = cpg_db_query($sql);

        $notes = array();

        while ($row = mysql_fetch_assoc($result)) {
            //$row['note'] = addslashes($row['note']);
            $notes[] = $row;
        }

and replace with
Code: [Select]
// pftq: Don't include the CPG user table; bridges don't use it
        $sql = "SELECT * FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate WHERE pid = {$data['pid']}";
        $result = cpg_db_query($sql);

        $notes = array();

        while ($row = mysql_fetch_assoc($result)) {
            //$row['note'] = addslashes($row['note']);
            $row['user_name']=get_username($row['user_id']); // pftq: Let CPG find the username, works with bridges
            $notes[] = $row;
        }

Still have to figure out why I'm getting "nullSave", "nullDelete" etc though. :D
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: pftq on December 19, 2010, 04:16:45 pm
Fixed the "null..." issue.  I had menu icons disabled for my gallery via Config > Themes.

The plugin actually accounts for this but for whatever reason, there's a block of code outside the condition:
Code: [Select]
$annotate_icon_array['announcement'] = cpg_fetch_icon('announcement', 1);
$annotate_icon_array['configure'] = cpg_fetch_icon('config', 1);
$annotate_icon_array['update_database'] = cpg_fetch_icon('update_database', 1);
$annotate_icon_array['import'] = cpg_fetch_icon('download', 1);
$annotate_icon_array['manage'] = cpg_fetch_icon('edit', 1);
$annotate_icon_array['ok'] = cpg_fetch_icon('ok', 2);
$annotate_icon_array['cancel'] = cpg_fetch_icon('cancel', 2);
$annotate_icon_array['delete'] = cpg_fetch_icon('delete', 2);

This should be moved inside the brackets for
Code: [Select]
if ($CONFIG['enable_menu_icons'] == 2) {
and then copy this into the else clause
Code: [Select]
       $annotate_icon_array['announcement'] = '';
$annotate_icon_array['configure'] = '';
$annotate_icon_array['update_database'] = '';
$annotate_icon_array['import'] = '';
$annotate_icon_array['manage'] = '';
$annotate_icon_array['ok'] = '';
$annotate_icon_array['cancel'] = '';
$annotate_icon_array['delete'] = '';


I also managed to get the textbox to wrap beneath the annotations if there isn't enough room going out to the side.  Might be just me, but the annotations too close to the right tended to go off screen.  The changes below solve it.  You can see how it works here:
http://www.pftq.com/gallery/displayimage.php?pid=3044
(the annotation to the far right wraps down instead)

The code is a bit long though:

In lib/photonotes.js
Replace the last couple lines of 'PhotoNote.prototype.PositionNote = function()' with:
Code: [Select]
   // pftq: Wrap to bottom, not extend off-screen
    var noteX = this.rect.left + this.YOffset + this.rect.width;
    var noteY  = this.rect.top - 4;
    if(noteX+3*this.rect.width>this.maxRight) {

if(noteX+2*this.rect.width<this.maxRight) {
//this.gui.ElementNote.style.width=(this.rect.width*2-this.YOffset)+'px';
}

else if(noteX+this.rect.width-this.YOffset<this.maxRight&&
this.maxRight-noteX>30) {
//this.gui.ElementNote.style.width=this.maxRight-noteX-this.YOffset+'px';
}

else {
var noteWidth=this.rect.width*2;
if(noteWidth>this.maxRight/2)
noteWidth=this.rect.width;
if(noteWidth>this.maxRight/2) noteWidth=this.maxRight/2;
while(noteWidth<50) noteWidth=50;
noteX= this.rect.left + this.YOffset*2 + (this.rect.width-noteWidth)/2;
if(noteX+noteWidth>this.maxRight)
noteX = this.maxRight - noteWidth-this.YOffset;
if(noteX<0) noteX=0;
noteY  = this.rect.top + this.rect.height + this.YOffset/2;
//this.gui.ElementNote.style.width=noteWidth+'px';
}
}
    this.gui.ElementNote.style.left  = noteX + 'px';
    this.gui.ElementNote.style.top  = noteY + 'px';

Change 'function PhotoNote(text,id,rect,annotator_name,annotator_id)' to
Code: [Select]
function PhotoNote(text,id,rect,annotator_name,annotator_id, maxRight)
Add above 'editable: true /* nibbler */' :
Code: [Select]
maxRight:maxRight, /* pftq */
Then in codebase.php, just add an extra $container_width argument to the following function calls:
Code: [Select]
var note = new PhotoNote(annotations[n].note, 'note' + n,...
Code: [Select]
var newNote = new PhotoNote(note_text, 'note' + n, new PhotoNoteRe...
Eh - sorry for all the code. :D I didn't expect to change so much of it, but I hope someone finds it useful. :)
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: hanzon2010 on December 28, 2010, 02:15:37 pm
Text not wrapping is a problem indeed for those with small screens, like on a laptop.  On my 21" or 19" monitor, no problem at all, lots of space for the annotation text to show even if it is at the rightmost of the picture.  It still is better if it can wrap within the image frame and not go past.  Good idea to fix this.

However, I checked your link, http://www.pftq.com/gallery/displayimage.php?pid=3044, and "Waste Ink Tubing" still does not wrap, and just goes past the frame of the image.  This is on my 21" monitor.  Since text is white and your background outside the image frame is also white, then one can't see the remaining text.  It is shown as "Waste Ink Tub".  Is this fix only for small screens ? 
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: pftq on December 28, 2010, 06:21:43 pm
Ah thanks for catching that.  It turns out to be a browser issue rather than the screen resolution.  On IE, it works fine but it seems like the text doesn't wrap in Firefox.

I'm trying things out to see why that might be, but I'm hoping someone who helped code the original plugin might know.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: pftq on December 28, 2010, 08:53:31 pm
Haven't figured out why the text isn't wrapping for Firefox yet, but in the mean time I updated the code I posted above so that it doesn't change the width of the textbox (so the text doesn't protrude out of it).

It still at least moves the text to the bottom if the note is too close to the right side.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: pftq on January 02, 2011, 12:22:25 pm
This is one more change to codebase.php that should be made:
Find
Code: [Select]
$data['menu'] = '<div class="buttonlist align_right"><ul>'.$menu_buttons.'</ul></div>';
Replace with:
Code: [Select]
$data['menu'] = '<div class="buttonlist align_right"><ul><li> </li>'.$menu_buttons.'</ul></div>';
Add "<!-- " under "<script type="text/javascript">".
Add "// -->" above "</script>".

Without the empty these changes, it becomes invalid HTML because of the javascript not being interpreted correctly by the W3C validator.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: cmfa on January 09, 2011, 06:41:16 pm
Hi @ all

attached an error message in Internet Explorer. It will not see a caption.
Also I have is the problem that the label on the blue background also.
The above instructions I have tried to replicate without success.
Who can help me here? all changes were reversed!!

http://fotofreunde-rathenow.adtg.de/Teil5 (http://fotofreunde-rathenow.adtg.de/Teil5)
VG
CMFA

Quote
Details zum Fehler auf der Webseite

Benutzer-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Zeitstempel: Sun, 9 Jan 2011 17:30:34 UTC


Meldung: Das Objekt unterstützt diese Aktion nicht.
Zeile: 424
Zeichen: 5
Code: 0
URI: http://fotofreunde-rathenow.adtg.de/Teil5/plugins/annotate/lib/photonotes.js


Meldung: 'notes.notes.0' ist Null oder kein Objekt
Zeile: 385
Zeichen: 1
Code: 0
URI: http://fotofreunde-rathenow.adtg.de/Teil5/displayimage.php?album=35&pid=212


Meldung: 'notes.notes.0' ist Null oder kein Objekt
Zeile: 385
Zeichen: 1
Code: 0
URI: http://fotofreunde-rathenow.adtg.de/Teil5/displayimage.php?album=35&pid=212


Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on January 19, 2011, 03:53:02 pm
On a side note, I added a preview of the annotation on the "Last annotations" page so it is similar to last comments.
Please post the needed code changes.


flickering boxes when the mouse moves over the picture.
Please elaborate. I haven't recognized that behavior (I'm using Firefox).


notes not showing for non-Admins
Can you please try if the following fix works as well?
In codebase.php, find
Code: [Select]
       $sql = "SELECT n.*, u.user_name FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate n INNER JOIN {$CONFIG['TABLE_USERS']} u ON n.user_id = u.user_id WHERE n.pid = {$data['pid']}";
        $result = cpg_db_query($sql);

        $notes = array();

        while ($row = mysql_fetch_assoc($result)) {
            //$row['note'] = addslashes($row['note']);
            $notes[] = $row;
        }
and replace with
Code: [Select]
       global $cpg_udb;
        $sql = "SELECT n.*, u.".$cpg_udb->field['username']." AS user_name FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate n INNER JOIN ".$cpg_udb->usertable." u ON n.user_id = u.".$cpg_udb->field['user_id']." WHERE n.pid = {$data['pid']}";
        $result = cpg_db_query($sql);

        $notes = array();

        while ($row = mysql_fetch_assoc($result)) {
            //$row['note'] = addslashes($row['note']);
            $notes[] = $row;
        }
Please report if that works, too.


Fixed the "null..." issue.
I'll commit that fix soon.


Your changes regarding wrapping the text beneath the annotation and the invalid HTML I have to do some more testing.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: pftq on January 19, 2011, 04:06:17 pm
Thanks Andre - I'm not at my home computer right now but will get back to you about those changes as soon as possible.

The flickering occurs in Internet Explorer (I know, everyone should use FF - but about half my visitors are not very tech-savy and just use IE).  It's mainly when your mouse moves across the white outline of the box (so as if pointing at the box outline is not pointing at the picture).
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: pftq on January 24, 2011, 02:33:57 pm
The fix for non-admin you posted works.  I'd like suggest the following which also includes date/time:
Code: [Select]
global $cpg_udb, $lang_date;
        $sql = "SELECT n.*, u.".$cpg_udb->field['username']." AS user_name FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate n INNER JOIN ".$cpg_udb->usertable." u ON n.user_id = u.".$cpg_udb->field['user_id']." WHERE n.pid = {$data['pid']}";
        $result = cpg_db_query($sql);

        $notes = array();

        while ($row = mysql_fetch_assoc($result)) {
            //$row['note'] = addslashes($row['note']);
           
            $row['date']=localised_date($row['user_time'], $lang_date['lastup']); // pftq: Show date on note
            $notes[] = $row;
        }

You can then do this in the photonotes.js file:
Code: [Select]
function PhotoNote(text,id,rect,annotator_name,annotator_id, date_str, maxRight) /* pftq: added date and maxRight */
{
    var props = {
        text: text,
        id: id,
        rect: rect,
        annotator_name: annotator_name,
        annotator_id: annotator_id,
        selected: false,
        container: null,
        dragresize: null,
        oldRect: null,
        YOffset: 10,
        XOffset: 0,
        onsave: null,
        ondelete: null,
        gui: null,
        highlighted: false,  /* pftq */
        date_str:date_str, /* pftq */
        maxRight:maxRight, /* pftq */
        editable: true /* nibbler */             
       
    };

Under // add annotator name and link to profile, you can use date_str to format the comment time as I've done here:
http://www.pftq.com/gallery/displayimage.php?pid=3044


For the last viewed (annotations), I currently have it implemented as a mod to build_caption which is why I didn't post the code.  I can look into using a plugin hook when I get a chance though.


If you want, I can attach the current version of the plugin I have now to maybe save you some of the work.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on January 24, 2011, 02:48:39 pm
If you want, I can attach the current version of the plugin I have now to maybe save you some of the work.
Thanks, but I've already applied some changes to my local working copy and also committed something to the svn repository. So I'll do the other changes manually, too.
Title: annotations for cpg1.5.x
Post by: haferlin on February 04, 2011, 06:14:42 pm
Hi
I got a problem it doesnt work with joomla bridge yet    version cpg1.5   what  could I do?
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: phill104 on February 04, 2011, 07:02:54 pm
You will unfortunately have to work that out for yourself. The bridge is from a third party and something we cannot support as we simply do not know it.
Title: Re: annotations for cpg1.5.x
Post by: Αndré on February 05, 2011, 10:17:35 am
it doesnt work with joomla bridge yet
If you say what exactly doesn't work, it may be possible to fix that without knowing the Joomla bridge.
Title: annotations for cpg1.5.x
Post by: haferlin on February 08, 2011, 03:50:38 pm
I figure  it is  request db` problem  because doesn't save annotation neither super administrator or administror

on version 1.4 cpg   worked perfect


*excuse me english
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: curtj on March 02, 2011, 07:13:44 pm
Great plugin! Thanks for creating this.

Is there a way I can get the note popup box to fit to the width of the contained text, and more importantly, is there a way for me to have the note popup box to be central to the target area.

I am using this plugin to allow clients to make comments about design work, and sometimes they have lengthy comments. When the popup appears it can be offscreen which I don't mind, but looks broken to the client.

I'm not much of a coder, but I can dabble a bit and if it comes to it I have access to developers.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on May 03, 2011, 04:30:40 pm
Version 2.11 fixes the display of the annotation buttons for pictures of other users if rapid annotation is enabled and currently displayed.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: oschmidt on June 15, 2011, 04:42:54 pm
Nice plugin... But is there a way to use the lightbox plugin (http://forum.coppermine-gallery.net/index.php/topic,62905.html) with the annotations plugin?

If i use booth i can´t place/see the annotations frame.

regards
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on June 15, 2011, 04:49:29 pm
If it currently doesn't work, you have to adjust at least one plugin. I currently have too little time and personal interest to make those plugins compatible, sorry.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: bulbator on August 12, 2011, 02:01:57 pm
The plug-in incorrectly works in a CPG on bridge mode (usual users don't have rights to addition of annotations). It can be corrected?
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: jazzysama on November 07, 2011, 12:55:47 am
I love this plug-in already, but I'd like to second curtj's request from a while back. Is there a way to modify the annotation note box itself for lengthier comments?  Ideally, it would be able to dynamically scale to the contents of the box, but if that's too much trouble, it'd be nice to know where I could preset the height/width of the note and I'll just define a size that notes are unlikely to go over; both cases I know that I need to introduce some form of line breaking (it'd be nice if this could be done while entering text).

I plan on using annotate for translations - basically I'll be creating an annotation over each sentence/paragraph and put the translations as the note. This will often lead to 2-3 (or more) lines of text. That said, I'll also be primarily the only one using this feature so I could get away with a "quick fix".

Any thoughts would be greatly appreciated!
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on August 06, 2012, 04:46:22 pm
Version 3.0 (attached to initial post) contains several changes. Detailed changelog (http://coppermine.svn.sourceforge.net/viewvc/coppermine/branches/cpg1.5.x/plugins/annotate/?view=log) can be found in the SVN repository. Most important are:
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: KyleClarkeNZ on August 19, 2012, 09:20:47 am
Hi, is there any way to have this plugin allow annotations be created/modiefied by only the image uploader and admin? currently it seems (v3.0) that if you allow a user group to create or modify annotations, they can do this on any and all images.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: KyleClarkeNZ on August 19, 2012, 10:22:49 pm
I'm getting a "stack overflow" error using IE8. Firefox works fine. on this image: http://nzgc.co.nz/displayimage.php?album=lastup&cat=0&pid=9

I'm assuming it's due to the number of annotations, but there's no fail safe preventing me from putting too many in (and how many is too many)
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Jeff Bailey on August 20, 2012, 09:16:46 pm
<!--Coppermine Photo Gallery 1.5.12 (stable)-->
You should upgrade.
http://forum.coppermine-gallery.net/index.php/topic,74682.0.html
http://documentation.coppermine-gallery.net/en/upgrading.htm

I'm not seeing annotations in Chrome or IE9, did you disable it?

This is most likely a independent browser issue.
http://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/stack-overflow-at-line-96/e75e61a7-09fd-4c83-8d66-6090bef07aa7
http://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/stack-overflow-at-line-92/4c321f6d-9e2e-4eac-a57c-3e6fff39709f
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Beau_M on October 12, 2012, 05:42:01 am
Hi guys,

I've noticed an issue on our site where the annotations move around on the photo when changing the screen size.  If anyone could shed some light on it, it would greatly appreciated as it's rather confusing when the annotation box for one person goes over another.  I am currently running the latest version (v3.0) of the annotations plugin however it has been doing this on every version.

A test account has been set up if required;
http://www.hittherock.com (http://www.hittherock.com)
username : Test
password : test
example page is http://www.hittherock.com/gallery/displayimage.php?pid=13#top_display_media (http://www.hittherock.com/gallery/displayimage.php?pid=13#top_display_media)
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on October 12, 2012, 09:08:49 am
example page is http://www.hittherock.com/gallery/displayimage.php?pid=13#top_display_media (http://www.hittherock.com/gallery/displayimage.php?pid=13#top_display_media)

Unfortunately I cannot see any annotations with the provided test user account.
Title: Re: Re: Flickr style image annotations for cpg1.5.x
Post by: Beau_M on October 12, 2012, 10:09:32 pm
Unfortunately I cannot see any annotations with the provided test user account.

Αndré, sorry I should have mentioned that the annotations can only be seen when logged in, that was the reason for the test account.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on October 17, 2012, 04:14:12 pm
I am logged in as user "Test", but cannot see any annotations.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Beau_M on October 17, 2012, 11:02:04 pm
Andre, sorry about that, now fixed.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on October 18, 2012, 09:24:20 am
Now I get a 404 error page when trying to access displayimage.php. Please check if the file exists and its permissions.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Beau_M on October 18, 2012, 11:01:50 pm
Argh I can't win!  Try this one instead, http://www.hittherock.com/Gallery/displayimage.php?pid=13#top_display_media (http://www.hittherock.com/Gallery/displayimage.php?pid=13#top_display_media)

Thanks for your patience Andre.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: rickmick on September 13, 2013, 09:49:31 pm
I am using Coppermine 1.5.24 and when I to to install the plugin cpg1.5.x_plugin_annotate_v3.0.zip I get this error

Critical error
There was an error while processing a database query
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on September 13, 2013, 10:09:50 pm
Please enable debug mode and post the extended error message. I assume it complains the "TYPE=MyISAM".
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: rickmick on September 13, 2013, 10:19:58 pm
Here it is thanks

Code: [Select]
While executing query '

CREATE TABLE IF NOT EXISTS `copper_plugin_annotate` (
  nid smallint(5) unsigned NOT NULL auto_increment,
  pid mediumint(8) unsigned NOT NULL,
  posx smallint(5) unsigned NOT NULL,
  posy smallint(5) unsigned NOT NULL,
  width smallint(5) unsigned NOT NULL,
  height smallint(5) unsigned NOT NULL,
  note text NOT NULL,
  user_id smallint(5) unsigned NOT NULL,
  PRIMARY KEY  (nid)
) TYPE=MyISAM  COMMENT='Contains the data for the annotate plugin'' in plugins/annotate/codebase.php on line 328

mySQL 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 'TYPE=MyISAM  COMMENT='Contains the data for the annotate plugin'' at line 11
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: rickmick on September 13, 2013, 10:22:03 pm
Sorry I lift this out

File: /home/rickmick/public_html/include/functions.inc.php - Line: 272
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: rickmick on September 13, 2013, 11:30:37 pm
I was able to change the schema.sql from
Code: [Select]
) TYPE=MyISAMto this
Code: [Select]
) ENGINE=MyISAM
I'm sure if that should be the way to do it but it works now.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on September 14, 2013, 08:35:29 pm
Remove
Code: [Select]
TYPE=MyISAM  COMMENT='Contains the data for the annotate plugin'from schema.sql and it should work as expected.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: mr5 on October 29, 2013, 02:46:29 pm
Tried to apply V3.
Get critical error. I have enabled the debug for all. Details in attachment. user=test; psw=test   Thanks.


[removed attachment by request]
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on October 29, 2013, 03:57:46 pm
Unfortunately your screenshot doesn't contain an error message. Without an error message I cannot fix anything.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: mr5 on October 29, 2013, 04:02:36 pm
Here is the text, sorry

While executing query '















CREATE TABLE IF NOT EXISTS `cpg15x_plugin_annotate` (
  nid smallint(5) unsigned NOT NULL auto_increment,
  pid mediumint(8) unsigned NOT NULL,
  posx smallint(5) unsigned NOT NULL,
  posy smallint(5) unsigned NOT NULL,
  width smallint(5) unsigned NOT NULL,
  height smallint(5) unsigned NOT NULL,
  note text NOT NULL,
  user_id smallint(5) unsigned NOT NULL,
  PRIMARY KEY  (nid)
) TYPE=MyISAM  COMMENT='Contains the data for the annotate plugin'' in plugins/annotate/codebase.php on line 328

mySQL 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 'TYPE=MyISAM  COMMENT='Contains the data for the annotate plugin'' at line 11
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on October 29, 2013, 04:07:57 pm
Please use the fix that's directly above your post ::)
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: mr5 on October 29, 2013, 04:26:17 pm
But there is no such text in codebase.php  of the plugin....  ????  Or am I completely crazy...
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on October 29, 2013, 04:29:07 pm
It's in schema.sql, sorry. I've just fixed the typo in my previous post.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: mr5 on October 29, 2013, 04:39:58 pm
Thanks Andre!!!
And sorry for not seeing he fix...   :)
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: mr5 on October 29, 2013, 04:47:47 pm
Can't find how to remove attachment. Don't wnt for anyone to see. Thanks
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on October 29, 2013, 04:50:14 pm
Can't find how to remove attachment.
Removed as requested.
Title: Estonian translation for Annotate
Post by: leeni on November 16, 2015, 08:00:48 pm
Hello!
I am sending an Estonian translation for Annotate Plugin v3.0 / cpg1.5x. You can use it as you like.
Regards, Leeni
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on November 23, 2015, 12:37:16 pm
Added in SVN revision 8834. Thank you for your contribution.
Title: Attempting to useannotations for cpg1.5.x(38 or 40)
Post by: bobmiers on December 31, 2015, 12:28:49 am
I'm attempting to use Flickr style image annotations for cpg1.5.x - using: cpg1.5.x_plugin_annotate_v3.0.zip (45.63 kB - downloaded 552 times.) from the announcement thread.  I'm doing this on a virgin copy of 1.5.40 from the admin login config plugin manager and get the following error:

"Critical error
There was an error while processing a database query"


Other plugins seem to work OK.

I note that the last time several files were edited was back in July and August of 2012, so I'm wondering if anyone has used this plugin in the most recent version of CPG?

Also, what php debugging program to the developers use.  Being able to step through code probably would lead me to the cause of the error.

A note to: Αndré & allvip, thanks to your help I've made my project "live" a couple of weeks ago and it works GREAT.

Any insight will be appreciated.

Bob Miers

Title: Re: Attempting to useannotations for cpg1.5.x(38 or 40)
Post by: ron4mac on January 01, 2016, 01:41:05 am
In the plugin file, schema.sql, remove "TYPE=MyISAM" in the last line of the file. (or change it to "ENGINE=MyISAM")
Title: Re: Attempting to useannotations for cpg1.5.x(38 or 40)
Post by: bobmiers on January 01, 2016, 02:40:13 pm
ron4mac

Thank you so very much.  I would have never discovered the fix.

Now I can see if it will accomplish the job that I want it to do.

Thank you,
Bob Miers
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on January 09, 2016, 10:17:23 pm
Merged with announcement thread. Will update the plugin as soon as possible.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: leeni on February 06, 2016, 01:15:27 am
There is possibly a bug in how the annotation links are formed above the photo. When a person appears on several photos in different categories and albums, clicking on such a link initiates a search. However, the results of such a search display the album title under the search result (instead of the actual title of the photo). Even more problematically, upon opening such a photo from such a link, the wrong caption is still displayed below the photo itself.
Title: Re: Flickr style image annotations for cpg1.5.x
Post by: Αndré on February 08, 2016, 12:03:30 pm
Please try if it works as expected if you replace
Code: [Select]
r.titlewith
Code: [Select]
p.titlein codebase.php.