[development] Created vs modified
Walt Daniels
wdlists at optonline.net
Thu Jul 13 03:55:19 UTC 2006
Ok, I will try to do that but I have never written a module so it is not
going to be as easy as you make it sound. It looks like I could also add a
reason field to the table and let the changer explain what they did, but
that would need something more complicated to keep track of the history of
changes, rather than just the last change.
It all sounds like something someone has already done. For example how do
wikis keep track of what happens?
> -----Original Message-----
> From: development-bounces at drupal.org
> [mailto:development-bounces at drupal.org] On Behalf Of Earl Miles
> Sent: Wednesday, July 12, 2006 11:33 PM
> To: development at drupal.org
> Subject: Re: [development] Created vs modified
>
> Walt Daniels wrote:
> > I see a created field and a changed field in the node table, but I
> > think these are dates not authors. There is also a uid
> which I suspect
> > is the author, perhaps tied to the authmap table?? But no
> change author.
> >
> > So what I want may not be as simple as you imply.
>
> It is as simple as:
>
> Creating a table with the fields you need (in this case, as I
> said, 'changed_by'), and a 'nid' to tie it to the node table.
>
> Implementing hook_nodeapi
>
> for 'insert' and 'update' events, writing the appropriate
> information (in this case, putting $user->uid into changed_by)
>
> for 'load' events loading the appropriate information.
>
> And do the rest via theming.
>
> It is as simple as I say (not imply).
More information about the development
mailing list