Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Pulling username  (Read 265 times)
0 Members and 1 Guest are viewing this topic.
kd4rdb
New Member
*

Karma: 0
Offline Offline

Posts: 0

engineer


WWW
« on: October 14, 2003, 02:50:00 PM »

I working with "calendar_admin.pl" trying to add a little something to notify users that their event has been approved or denied.  

in the $in{'command'} eq "approve_events" section (approx line 1056), I see that a call is made to $db->updateRecords( {'id'=>$id} , {'approved'=>1} ); to alter the approved status to "1".  

What call can I use to get the username of the person who created this event?  

Once I know their username (which is coincidentally their email address on our server), it's a simple matter to spit out an email to them with a little message informing them of the acceptance of their event.

Wes

Logged
kd4rdb
New Member
*

Karma: 0
Offline Offline

Posts: 0

engineer


WWW
« Reply #1 on: October 15, 2003, 12:51:00 PM »

I ended up seeding the author_id forward into the approve.html file ...

approx line 60:
<SELECT NAME="APPROVE_<%=$id%>_<%=$username%>"><OPTION VALUE="">No Action</OPTION><OPTION VALUE="APPROVE">Approve</OPTION><OPTION VALUE="REJECT">Reject</OPTION></SELECT>   

and in CALENDAR_ADMIN.PL approx line 1053, I pull the user's name back out...

         next unless ($key =~ /^APPROVE_(\d+)_(\D+)/);
         $id = $1;
         $userid= $2;

Wes

[This message has been edited by kd4rdb (edited October 15, 2003).]

[This message has been edited by kd4rdb (edited October 15, 2003).]

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #2 on: October 15, 2003, 01:01:00 PM »

** What call can I use to get the username of the person who created this event? **

Any page which has access to the event's data also has access to the poster's username and display name as they are both stored in the event record. How you would display it would depend on the page which you want it displayed on.

BTW. TubaDave's 'Email Notification' plug-in might be able to be modified to provide such a notification automatically after events are approved. It was originally designed to just email the Administrator when such events were awaiting approval.

Dan O.
Unofficial CalendarScript - Mods and Plugins site

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: