We're pleased to announce the acquisition of
eTicket!
Looking for a better way to talk to your customers? Try eTicket!
Home
Help
Search
Login
Register
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search
Advanced search
8043
Posts in
1856
Topics- by
2099
Members
- Latest Member:
roi
Calendar Script Community
Customization
Customizing CalendarScript
(Moderators:
scott
,
DanO
,
Marty
)clickable email link
« previous
next »
Pages: [
1
]
Go Down
Author
Topic: clickable email link (Read 740 times)
0 Members and 1 Guest are viewing this topic.
ai4px
New Member
Karma: 0
Offline
Posts: 4
clickable email link
«
on:
July 17, 2007, 03:24:21 PM »
I've customized the user database to include a field called email. When a given user looks at an event that was created by another user, I want to have a clickable MAILTO: link that points to the author's email address. Now I could do something like mailto:<%=$User->{email}%>, but that's the current logged in user, not the author's email address. How can I get the author's email address?
Wes
Logged
DanO
Moderator
Full Member
Karma: 13
Offline
Posts: 230
Please don't PM me. Post in the open forum.
Re: clickable email link
«
Reply #1 on:
July 17, 2007, 06:23:14 PM »
See if the following previous forum message has what you're looking for:
LINK >
AUTOLINK (email address)
Dan O.
www.much2.com
Logged
ai4px
New Member
Karma: 0
Offline
Posts: 4
Re: clickable email link
«
Reply #2 on:
July 17, 2007, 06:57:30 PM »
Thanks for the reply, but that thread seems to concentrate more on formatting the HTML output, not getting fields from the user database. So still, the question remains how to get a specific field about a specific user from teh user database.
:-(
Wes
Logged
ai4px
New Member
Karma: 0
Offline
Posts: 4
Re: clickable email link
«
Reply #3 on:
July 18, 2007, 07:29:08 AM »
Is there a way to make a call to the new user subroutine to request info about a particular user?
I'm thinking about calling it and having it stuff another hash with user info. . . . for example, if I called it $user1, then $user hash would still contain the current logged in user, and user1 hash would contain the user I was querying.
Wes
It's located in USER. PM file. . .
sub new {
my ($class,$username,$users_db,$permissions_db) = @_;
my $self = bless { }, $class;
$self->{'username'} = $username;
unless ($username && $users_db && $permissions_db) {
return $self;
}
$self->{'_users_db'} = new DBFile($users_db);
$self->{'_permissions_db'} = new DBFile($permissions_db);
my ($record) = $self->{'_users_db'}->getRecord( {'username'=>$username} );
if ($record) {
foreach $key (keys %$record) {
$self->{$key} = $record->{$key};
}
$self->readPermissions();
$self->{'_is_valid'} = 1;
}
return $self;
}
Logged
ai4px
New Member
Karma: 0
Offline
Posts: 4
Re: clickable email link
«
Reply #4 on:
July 18, 2007, 09:22:09 AM »
I got it!!! Maybe this will help others.
Wes
bear in mind that I added a field to the user database called email that contains each user's email address.
$lookupuserdb='c:\inetpub\wwwroot\cgi-bin\calendar\/calendarscript/users';
$lookuppermdb='c:\inetpub\wwwroot\cgi-bin\calendar\/calendarscript/permissions';
$User1 = new User($EVENT->{details}->{author_id}, $lookupuserdb, $lookuppermdb);
<a href="mailto:<%=$User1->{email}%>?subject=<%=EVENT FIELD(title)%>"><%=$User1->{name}%></a>
Logged
DanO
Moderator
Full Member
Karma: 13
Offline
Posts: 230
Please don't PM me. Post in the open forum.
Re: clickable email link
«
Reply #5 on:
July 18, 2007, 12:46:49 PM »
** that thread seems to concentrate more on formatting the HTML output, not getting fields from the user database. **
Sorry, I thought you wanted an email address that was listed in the event details made into a link.
Glad to hear you figured it out.
Dan O.
Logged
DanO
Moderator
Full Member
Karma: 13
Offline
Posts: 230
Please don't PM me. Post in the open forum.
Re: clickable email link
«
Reply #6 on:
July 18, 2007, 01:00:55 PM »
** $lookupuserdb='c:\inetpub\wwwroot\cgi-bin\calendar\/calendarscript/users'; **
PS. When defining paths in Perl, you'll either need to escape \'s (backslashes). Eg.
c:\\inetpub\\wwwroot\\cgi-bin\\calendar\\calendarscript\\users
Or use /'s (forward slashes) in place of them, which would be the preferred method. Eg.
c:/inetpub/wwwroot/cgi-bin/calendar/calendarscript/users
JFYI
Dan O.
Logged
Pages: [
1
]
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> FAQS
=> Advertise on CalendarScript
-----------------------------
Setup and Installation
-----------------------------
=> Installation and Setup
=> Problems and Solutions
-----------------------------
Customization
-----------------------------
=> Customizing CalendarScript
=> Hacks and Mods
=> Plugins
-----------------------------
Making CalendarScript Better
-----------------------------
=> Suggestions and Ideas
=> Showcase
-----------------------------
Licensing
-----------------------------
=> Licensing
-----------------------------
Everything Else
-----------------------------
=> General Use