default copyright per each user
ksoonson - April 29, 2007 - 02:27
| Project: | Copyright |
| Version: | 5.x-1.1 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
it would be great if the user can set his/her default copyright for his/her content so that he/she does not have to set copyright every time he/she posts a new node.
thanks very much for nice module!

#1
Patch attached.
All the new functions are at the bottom of the file for easy reference. I don't know if this is bad etiquette or not; correct me if it is.
I may not have abstracted out the database-writing functions enough; I know for a fact it's not consistent with the current private DB-writing functions, but I wasn't sure it needed to be in this case.
I eagerly await input and correction on anything I've done wrong.
DISCLAIMER
This is my first Drupal patch, as well as my first real contribution to any stable base of code in any language.
This patch may not work. This patch may melt your hard drive. This patch may rape your wife and enslave your children.
I'm a newbie. You have been warned.
#2
Patch actually attached this time. >.<
#3
And I forgot, this requires a new database table called {copyright_user} with two columns: uid (int(10), primary key) and cpyid (int(10)).
Will work on patching copyright.install.
#4
I will test the patch later today. Some observations:
$op = 'delete'forhook_user(): remove the row for that user,<?php+ if ($notices) {
+ $license .= ' (';
+
+ foreach($notices as $key => $notice) { // Iterate through the accumulated notices and add the text
+ $license .= $notice;
+ if ($key < (count($notices) - 1)) {
+ $license .= ', ';
+ }
+ }
+ $license .= ')';
+ }
?>
use
<?phpif (count($notices)) {
$license .= '('. implode(',', $notices) .')';
}
?>
$defaultto$site_defaultso it is clearly different from$user_default. At one point someone may add$type_default. Renaming the variable$defaultmay make it more clear what default we are talking about later on,if ($user_default > 0)instead ofif ($user_default). Or useif (isset($user_default),/******************************************************************* Support for user default copyright.
******************************************************************/
thingy above your set of functions.
The rest looks fine (but I haven't tested it). Implement a patch for
copyright.install, which should implementcopyright_update_5()which creates the new table (next to creating the table incopyright_install().Thanks a lot!
#5
hehh, I feel stupid about that
implode()thing. I knew the function existed, but couldn't think of the name. <.<;;Thanks for the help. I should get to this tonight or tomorrow. Should I submit a patch to my patch, or a patch to the original file pre-patch?
#6
No problem.
The patch should be against the original file, not to an already patched file.
Oh, by the way: is this for Drupal 4.7.x or 5.x ? Please indicate it when you follow up on this issue with your new patch.
#7
For what it's worth: I'm in favour of this feature.
#8
hehe... I also love this feature very much... :-)
#9
75th trombone: any update on this? Basically the patch was ok, just some minor cleanups. Attach a new patch so I can easiliy commit it.
Thanks!
#10
Fiex in 5.x-1.x-dev. Will be included in the next release of copyright module (5.x-1.1).
#11
Yeah! Great news~
#12
when will the new version be released so that people can try / use?
will it be okay for using CVS version?
I am anxious to see the new version with this feature~~
#13
New version has been released: 5.x-1.1. If there are any problems with it, create an new issue with some bug report. Thanks!
#14