Picture Annotation for cpg1.6.x Picture Annotation for cpg1.6.x
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Picture Annotation for cpg1.6.x

Started by Αndré, November 02, 2018, 03:04:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

This is the cpg1.6.x and PHP7 compatible version of the Picture Annotation plugin.

Quote from: Α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' created by Nibbler.

gor

Whenever I install this plugin, I get a "Critical Error" on the Plugin Manager page.
Upon enabling debug mode, I find:

QuoteWhile 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!

gor

Actually, I removed the SQL queries from the update.sql schema:

QuoteALTER 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

gor

OK so, that doesn't enable the saving of annotations.
So, I'm still no further forward.

Help! :)

Αndré

It seems I currently broke my testbed. Please try if the following fixes the issue. Open configuration.php, find
if ($CONFIG['plugin_annotate_import'] != "1" && cpg_db_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PREFIX']}notes"), 0) > 0) {
and replace with
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) {

gor

Hi Andre!

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

QuoteCritical 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'

gor

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:

QuoteWhile 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

gor

I deleted the column name "user_time" and now it's giving this error:

QuoteWhile 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....

Αndré

That's the same I got. I need to check the installation process in detail. I'll let you know as soon as possible.

gor

Thanks Andre,

I really appreciate the support.  :)

Αndré

Please try version 3.2 (attached to initial post).

gor

Looks like you've fixed the issue!
Installs, configures, and saves annotations!

Thank you so much!
-Gor

gor

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.

Αndré

Quote from: 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.
Thanks for the report. Actually it is saved, but "just" not displayed. Seems I need to have another closer look at the plugin.

Αndré


gor

Hi Andre,

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

Thanks again!
-Gor

Αndré

Version 3.3 includes that fix and has been added to the initial post.

allvip

Debug \plugins\annotate\codebase.php


    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)