Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: Picture Annotation for cpg1.6.x  (Read 11462 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Picture Annotation for cpg1.6.x
« 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' created by Nibbler.
« Last Edit: April 04, 2019, 09:44:20 am by Αndré »
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #1 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!
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #2 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
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #3 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! :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Picture Annotation for cpg1.6.x
« Reply #4 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) {
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #5 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'
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #6 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
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #7 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....
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Picture Annotation for cpg1.6.x
« Reply #8 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.
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #9 on: April 03, 2019, 07:51:45 pm »

Thanks Andre,

I really appreciate the support.  :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Picture Annotation for cpg1.6.x
« Reply #10 on: April 03, 2019, 09:21:25 pm »

Please try version 3.2 (attached to initial post).
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #11 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
Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #12 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Picture Annotation for cpg1.6.x
« Reply #13 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Picture Annotation for cpg1.6.x
« Reply #14 on: April 03, 2019, 10:54:04 pm »

Logged

gor

  • Coppermine newbie
  • Offline Offline
  • Posts: 13
Re: Picture Annotation for cpg1.6.x
« Reply #15 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
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Picture Annotation for cpg1.6.x
« Reply #16 on: April 04, 2019, 09:45:00 am »

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

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Picture Annotation for cpg1.6.x
« Reply #17 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)

Logged
Pages: [1]   Go Up
 

Page created in 0.036 seconds with 19 queries.