forum.coppermine-gallery.net

Support => cpg1.6 plugins => cpg1.6.x Support => cpg1.6 plugin contributions => Topic started by: Αndré on November 02, 2018, 03:04:40 pm

Title: Picture Annotation for cpg1.6.x
Post by: Αndré on November 02, 2018, 03:04:40 pm
This is the cpg1.6.x and PHP7 compatible version of the Picture Annotation plugin.

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.
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 03:31:15 am
Whenever I install this plugin, I get a "Critical Error" on the Plugin Manager page.
Upon enabling debug mode, I find:

Quote
   While executing query 'SELECT COUNT(*) FROM cpg_notes' in plugins/annotate/configuration.php on line 45

   database error: 1146 : Table 'coppermine_db.cpg_notes' doesn't exist

   Source: coppermine/include/functions.inc.php - Line: 250

I have to manually remove the plugin via FTP to get the Plugin Manager back.

In schema.sql, I see the database "CPG_plugin_annotate" called out, and there definitely isn't a "cpg_notes" table in my db.

Any advice?
I really loved this plugin in the past.
I'm using Coppermine Photo Gallery 1.6.06 (stable)

Thanks!
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 04:32:56 pm
Actually, I removed the SQL queries from the update.sql schema:

Quote
ALTER TABLE `CPG_plugin_annotate` ADD user_time int(9) default NULL;

DELETE FROM `CPG_config` WHERE name LIKE 'plugin_annotate_permissions_guest';
DELETE FROM `CPG_config` WHERE name LIKE 'plugin_annotate_permissions_registered';

INSERT INTO `CPG_config` (name, value) VALUES ('plugin_annotate_type', '1');
INSERT INTO `CPG_config` (name, value) VALUES ('plugin_annotate_disable_mobile', '0');

This successfully allowed the plugin to install, and apparently it works.
Not sure I'm comfortable with this though. Can you explain what's going on here?

Thanks,
-Gor
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 04:39:53 pm
OK so, that doesn't enable the saving of annotations.
So, I'm still no further forward.

Help! :)
Title: Re: Picture Annotation for cpg1.6.x
Post by: Αndré on April 03, 2019, 06:03:37 pm
It seems I currently broke my testbed. Please try if the following fixes the issue. Open configuration.php, find
Code: [Select]
if ($CONFIG['plugin_annotate_import'] != "1" && cpg_db_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PREFIX']}notes"), 0) > 0) {and replace with
Code: [Select]
if ($CONFIG['plugin_annotate_import'] != "1" && cpg_db_num_rows(cpg_db_query("SELECT table_name FROM information_schema.tables WHERE table_schema = '{$CONFIG['dbname']}' AND table_name = '{$CONFIG['TABLE_PREFIX']}notes'")) && cpg_db_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PREFIX']}notes"), 0) > 0) {
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 06:11:45 pm
Hi Andre!

Thanks, that fixed the install.
Once on the configuration page though, I get the following when saving the configuration:

Quote
Critical error

There was an error while processing a database query.

While executing query '















ALTER TABLE `cpg_plugin_annotate` ADD user_time int(9) default NULL' in plugins/annotate/codebase.php on line 325

database error: 1060 : Duplicate column name 'user_time'
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 06:14:53 pm
That was on:
File: coppermine/include/functions.inc.php - Line: 250

Also, the plugin didn't install all the way, and upon trying to install again, I get:

Quote
While executing query '















ALTER TABLE `cpg_plugin_annotate` ADD user_time int(9) default NULL' in plugins/annotate/codebase.php on line 325

database error: 1060 : Duplicate column name 'user_time'

File: coppermine/include/functions.inc.php - Line: 250
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 06:37:58 pm
I deleted the column name "user_time" and now it's giving this error:

Quote
While executing query '

INSERT INTO cpg_config (name, value) VALUES ('plugin_annotate_type', '1')' in plugins/annotate/codebase.php on line 325

database error: 1062 : Duplicate entry 'plugin_annotate_type' for key 'PRIMARY'

FYI....
Title: Re: Picture Annotation for cpg1.6.x
Post by: Αndré on April 03, 2019, 07:12:05 pm
That's the same I got. I need to check the installation process in detail. I'll let you know as soon as possible.
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 07:51:45 pm
Thanks Andre,

I really appreciate the support.  :)
Title: Re: Picture Annotation for cpg1.6.x
Post by: Αndré on April 03, 2019, 09:21:25 pm
Please try version 3.2 (attached to initial post).
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 09:52:25 pm
Looks like you've fixed the issue!
Installs, configures, and saves annotations!

Thank you so much!
-Gor
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 09:59:58 pm
I tried placing annotations with an unregistered account (not logged in) and I can place an annotation, but it's not saved.
That's fair enough. I don't need that functionality.
Title: Re: Picture Annotation for cpg1.6.x
Post by: Αndré on April 03, 2019, 10:25:05 pm
I tried placing annotations with an unregistered account (not logged in) and I can place an annotation, but it's not saved.
Thanks for the report. Actually it is saved, but "just" not displayed. Seems I need to have another closer look at the plugin.
Title: Re: Picture Annotation for cpg1.6.x
Post by: Αndré on April 03, 2019, 10:54:04 pm
Please check if it works as expected with that fix: https://github.com/coppermine-gallery/cpg1.6.x-plugins/commit/3e436d9b3bc196ccf13aa93dd24edd31dbde3826
Title: Re: Picture Annotation for cpg1.6.x
Post by: gor on April 03, 2019, 11:16:35 pm
Hi Andre,

Updated codebase.php, and the language files, and all seems to be working great!!

Thanks again!
-Gor
Title: Re: Picture Annotation for cpg1.6.x
Post by: Αndré on April 04, 2019, 09:45:00 am
Version 3.3 includes that fix and has been added to the initial post.
Title: Re: Picture Annotation for cpg1.6.x
Post by: allvip on August 07, 2020, 12:57:15 pm
Debug \plugins\annotate\codebase.php

Code: [Select]
    Warning line 36: Use of undefined constant panorama_viewer_is_360_degree_panorama - assumed 'panorama_viewer_is_360_degree_panorama' (this will throw an Error in a future version of PHP)
    Warning line 92: Use of undefined constant panorama_viewer_is_360_degree_panorama - assumed 'panorama_viewer_is_360_degree_panorama' (this will throw an Error in a future version of PHP)
    Warning line 202: Use of undefined constant panorama_viewer_image - assumed 'panorama_viewer_image' (this will throw an Error in a future version of PHP)
    Warning line 219: Use of undefined constant panorama_viewer_image - assumed 'panorama_viewer_image' (this will throw an Error in a future version of PHP)