I have a field named "Last Modified" setup in %db_def in the default.cfg file. I am trying to get the date to be automatically added to that field whenever someone modify's their record. Anybody - help please?
Mar 26, 1999, 1:38 AM
Veteran / Moderator (8669 posts)
Mar 26, 1999, 1:38 AM
Post #2 of 9
Views: 2250
May 12, 1999, 9:15 PM
Veteran / Moderator (8669 posts)
May 12, 1999, 9:15 PM
Post #4 of 9
Views: 2231
What about Users? I would like to show who modified the record last. Is this possible?
I would like this information to show up in the "Modification Form".
(Yes, I know that I could just look at the default.log file and get that information. But sifting through a long log file is not very economical.)
Any assistance would be quite helpful.
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited May 13, 1999).]
I would like this information to show up in the "Modification Form".
(Yes, I know that I could just look at the default.log file and get that information. But sifting through a long log file is not very economical.)
Any assistance would be quite helpful.
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited May 13, 1999).]
That makes sense. However, I am looking for a method that will automatically put the last modified user in the table. The suggestions you gave seem to be a manual way of keeping track of the last modifier. Is there a way to have the last modifier show up automatically?? I assume that there would have to be some tweaking with the db.cgi file.
Thanks for your suggestion, Carol.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Thanks for your suggestion, Carol.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
May 14, 1999, 9:26 AM
Veteran / Moderator (8669 posts)
May 14, 1999, 9:26 AM
Post #8 of 9
Views: 2224
Setting
$rec{'LastModifiedBy'} = $db_userid;
is about as automatic as it gets. You could do it in sub modify_record in db.cgi, in db.cgi if you wanted, but I'm not sure what the advantage would be. I try to avoid editing the db.cgi script if I can, because every time you do, you are limiting the use of the script for other databases. (This might not be a factor for you, but that's my modus operandi. )
$rec{'Last Modified'} = &get_date;
ONLY after ONE particular field is modified?
i.e. $rec('registered') is set to yes by a user.
You mean you only want to write to the 'Last Modified' filed if the value of the 'registered' field has been changed? Boy, that's a real toughie.
The way the modify script is set up, there is no way to see what the record was before it was modified. This would take a major rewriting of the entire modify_record subroutine.
------------------
JPD
$rec{'LastModifiedBy'} = $db_userid;
is about as automatic as it gets. You could do it in sub modify_record in db.cgi, in db.cgi if you wanted, but I'm not sure what the advantage would be. I try to avoid editing the db.cgi script if I can, because every time you do, you are limiting the use of the script for other databases. (This might not be a factor for you, but that's my modus operandi. )
Quote:
What if I only want to run: $rec{'Last Modified'} = &get_date;
ONLY after ONE particular field is modified?
i.e. $rec('registered') is set to yes by a user.
You mean you only want to write to the 'Last Modified' filed if the value of the 'registered' field has been changed? Boy, that's a real toughie.
The way the modify script is set up, there is no way to see what the record was before it was modified. This would take a major rewriting of the entire modify_record subroutine.
------------------
JPD