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
the zip is broken
Offline
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
Hi all,
Sorry that's my fault. I downloaded the directory listing instead of the zip inside it. Fixed.
Bye,
Johan
Offline
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
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
Do you want a place in the SVN repository for this plugin?
Offline
plg wrote:
Do you want a place in the SVN repository for this plugin?
Yes please, thank you!
Offline
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
Hum... sorry, I received the notification email while writing my previous post.
Offline
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
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
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:
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
That is a good idea! Thank you. Will implement it asap.
Offline
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