Hi. I want to edit PHPMyEdit a little bit. We're using it on our site to configure address books. Every address book requires an email address field. Where we display the form, I would like to change it from being static text to a mailto: link.
Basically, the email address will look the same (displays "person@someplace.com") but can be clicked on. The URL would be "mailto:person@someplace.com"
This doesn't seem like it would be hard, but I looked at the code and got a little scared. Is this easy to do? Can anyone help?
Thanks,
~James
PHPMyEdit: Display Email fields as mailto: links
Moderator: General Moderators
-
jim2point0
- Forum Newbie
- Posts: 3
- Joined: Thu Jul 31, 2008 2:21 pm
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: PHPMyEdit: Display Email fields as mailto: links
Yes it is easy, just add some basic html.
Code: Select all
<?php
// plain text
name@domain.com
// mailto
<a href="mailto:name@domain.com">name@domain.com</a>
-
jim2point0
- Forum Newbie
- Posts: 3
- Joined: Thu Jul 31, 2008 2:21 pm
Re: PHPMyEdit: Display Email fields as mailto: links
I understand that. But I'm talking about PHPMyEdit. If someone knows that well enough to be able to tell me where at in the code I need to do this, that would be great.
For example, PHPMyEdit displays fields like this:
[field name] [field name] [field name]
[record] [record] [record]
Right now, someone might have an address book like this:
[Email] [phone] [address]
[guy@place.com] 2323241124 Such and such
I need each email to render as a clickable link in the PHPMyEdit table. I dont want the data to be stored as a link, but I want PHPMyEdit to render them as links. So it will link to "mailto:guy@place.com" but will display as an underlined link, with the text "guy@place.com"
For example, PHPMyEdit displays fields like this:
[field name] [field name] [field name]
[record] [record] [record]
Right now, someone might have an address book like this:
[Email] [phone] [address]
[guy@place.com] 2323241124 Such and such
I need each email to render as a clickable link in the PHPMyEdit table. I dont want the data to be stored as a link, but I want PHPMyEdit to render them as links. So it will link to "mailto:guy@place.com" but will display as an underlined link, with the text "guy@place.com"
-
jim2point0
- Forum Newbie
- Posts: 3
- Joined: Thu Jul 31, 2008 2:21 pm
Re: PHPMyEdit: Display Email fields as mailto: links
Can you post the code that will display the email address?
Before that code you have to add <a href=mailto>
Thanks
Before that code you have to add <a href=mailto>
Thanks
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Re: PHPMyEdit: Display Email fields as mailto: links
Where is their manual? What do their templates look like?
Re: PHPMyEdit: Display Email fields as mailto: links
As an example... The PME class supports what you are asking for already. It's in the manual. =)
Code: Select all
<?php
$opts['fdd']['userEmail'] = array(
'name' => 'User Email',
'URL' => 'mailto:$value', // <-- right here
'select' => 'T',
'maxlen' => 255,
'sort' => true
);
?>
Last edited by RobertGonzalez on Fri Aug 29, 2008 6:00 pm, edited 1 time in total.
Reason: Please, for the love of coffee, use [php] tags in your posts when posting code
Reason: Please, for the love of coffee, use [php] tags in your posts when posting code