Announcement

#1 2011-05-14 20:53:38

J.Commelin
Member
2011-01-08
36

[Plugin] Copyrights v1.0

Hi all,

I just uploaded the first version of Copyrights plugin:
[extension by J.Commelin] Copyrights

This plugin allows the administrator to create a list of copyrights. (The plugin comes with 6 copyrights of Creative Commons by default.) These copyrights can then be assigned to photos via the Batch manager.

I would really like to hear your feedback on this plugin. Also I could use some help in making the plugin ready for translation, since I do not really know how that works. Finally, I would like to make the plugin working with the Single mode of the Batch manager, for it only works in Global mode at the moment. (Still working on that, and I would appreciate hints or help with it, because I could not find an appropriate event or action for it.)

Goodbye,
Johan Commelin

Last edited by J.Commelin (2011-07-09 17:31:07)

Offline

 

#2 2011-05-14 20:58:14

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7207

Re: [Plugin] Copyrights v1.0

the zip is broken


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2011-05-14 21:00:05

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [Plugin] Copyrights v1.0

Hi J.Commelin,

I think there is a problem with the archive, when I try to install from my plugin manager, I get "Archive cannot be read or extracted." and when I open it after a direct download, I only see a text file with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
  <title>Index of /mediademo/plugins/copyrights</title>
</head>
<body>
<h1>Index of /mediademo/plugins/copyrights</h1>
<ul><li><a href="/mediademo/plugins/"> Parent Directory</a></li>
<li><a href="INSTALL"> INSTALL</a></li>
<li><a href="README"> README</a></li>
<li><a href="admin.php"> admin.php</a></li>
<li><a href="admin.tpl"> admin.tpl</a></li>
<li><a href="batch.tpl"> batch.tpl</a></li>
<li><a href="include/"> include/</a></li>
<li><a href="language/"> language/</a></li>
<li><a href="main.inc.php"> main.inc.php</a></li>
<li><a href="maintain.inc.php"> maintain.inc.php</a></li>
<li><a href="manage_copyrights.php"> manage_copyrights.php</a></li>
</ul>
<address>Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.4 Perl/v5.8.8 Server at www.watergallery.nl Port 80</address>
</body></html>

Offline

 

#4 2011-05-14 21:14:06

J.Commelin
Member
2011-01-08
36

Re: [Plugin] Copyrights v1.0

Hi all,

Sorry that's my fault. I downloaded the directory listing instead of the zip inside it. Fixed.

Bye,
Johan

Offline

 

#5 2011-05-14 21:23:18

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [Plugin] Copyrights v1.0

OK fine, I've been able to install the plugin.

* I've edited the copyright list : simple and clear admin screen, good point :-)
* I've applied a copyright to several photos from the global batch manager with no probleme, good point :-)

But I can't see this copyright displayed anywhere.

Note : the table piwigo_copyrights_media is empty.

Offline

 

#6 2011-05-14 21:31:22

J.Commelin
Member
2011-01-08
36

Re: [Plugin] Copyrights v1.0

plg wrote:

OK fine, I've been able to install the plugin.

* I've edited the copyright list : simple and clear admin screen, good point :-)
* I've applied a copyright to several photos from the global batch manager with no probleme, good point :-)

Thank you

plg wrote:

But I can't see this copyright displayed anywhere.

That is true. I'm still figuring out how to do that. Probably add some icon to the copyrights and display that.

plg wrote:

Note : the table piwigo_copyrights_media is empty.

Hmm, that's nasty. I inspected the code of mass_updates, and found the problem.

The function mass_updates only updates records. If a certain media_id does not exist in piwigo_copyrights_media it is not inserted as new. Do you know how to solve this problem?

Goodbye,
Johan

Offline

 

#7 2011-05-14 21:32:43

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [Plugin] Copyrights v1.0

Do you want a place in the SVN repository for this plugin?

Offline

 

#8 2011-05-14 21:34:10

J.Commelin
Member
2011-01-08
36

Re: [Plugin] Copyrights v1.0

plg wrote:

Do you want a place in the SVN repository for this plugin?

Yes please, thank you!

Offline

 

#9 2011-05-14 21:38:34

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [Plugin] Copyrights v1.0

J.Commelin wrote:

plg wrote:

Do you want a place in the SVN repository for this plugin?

Yes please, thank you!

Then go to http://piwigo.org/ext/extension_view.php?eid=537 and click on the "Request Subversion Hosting" button (cloud icon).

Offline

 

#10 2011-05-14 21:39:17

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [Plugin] Copyrights v1.0

Hum... sorry, I received the notification email while writing my previous post.

Offline

 

#11 2011-05-14 21:40:52

J.Commelin
Member
2011-01-08
36

Re: [Plugin] Copyrights v1.0

Ok, I did that.

Do you have a solution for the problem with mass_updates that I described above? Should I probably add an extra column to the piwigo_images table, instead of creating a new table? For I guess that I can use mass_updates in that case...

Offline

 

#12 2011-05-14 21:42:58

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [Plugin] Copyrights v1.0

please, in your main.inc.php, the plugin URI must be http://piwigo.org/ext/extension_view.php?eid=537 if you want future automatic upgrade to work.

Offline

 

#13 2011-05-14 21:53:00

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [Plugin] Copyrights v1.0

J.Commelin wrote:

Do you have a solution for the problem with mass_updates that I described above? Should I probably add an extra column to the piwigo_images table, instead of creating a new table? For I guess that I can use mass_updates in that case...

OK, so you have understood correctly : the mass_updates function does not create new rows.

I suggest you to use something like:

Code:

if (count($collection) > 0)
{
  $query = '
DELETE
  FROM '.COPYRIGHTS_MEDIA.'
  WHERE media_id IN ('.implode(',', $collection).')
;';
  pwg_query($query);
}

$edits = array();
foreach ($collection as $image_id)
{
  array_push(
    $edits,
    array(
      'media_id' => $image_id,
      'cr_id' => $crID,
      )
    );
}

mass_inserts(
  COPYRIGHTS_MEDIA, // Table name
  array_keys($edits[0]),
  $edits // Data
  );

Offline

 

#14 2011-05-14 21:58:50

J.Commelin
Member
2011-01-08
36

Re: [Plugin] Copyrights v1.0

That is a good idea! Thank you. Will implement it asap.

Offline

 

#15 2011-05-14 22:02:08

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: [Plugin] Copyrights v1.0

The solution to use a distinct table for your plugin is good. Yes you could add extra columns in the core table, but as long as their is no performance issue, I think a separate table is a best solution.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact