PHPMyEdit: Display Email fields as mailto: links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jim2point0
Forum Newbie
Posts: 3
Joined: Thu Jul 31, 2008 2:21 pm

PHPMyEdit: Display Email fields as mailto: links

Post by jim2point0 »

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
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: PHPMyEdit: Display Email fields as mailto: links

Post by jaoudestudios »

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

Post by jim2point0 »

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"
jim2point0
Forum Newbie
Posts: 3
Joined: Thu Jul 31, 2008 2:21 pm

Re: PHPMyEdit: Display Email fields as mailto: links

Post by jim2point0 »

Anyone?
coder500
Forum Newbie
Posts: 20
Joined: Fri Jul 25, 2008 10:24 am
Location: Singapore

Re: PHPMyEdit: Display Email fields as mailto: links

Post by coder500 »

Can you post the code that will display the email address?
Before that code you have to add <a href=mailto>
Thanks
User avatar
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

Post by RobertGonzalez »

Where is their manual? What do their templates look like?
Pupster
Forum Newbie
Posts: 1
Joined: Fri Aug 29, 2008 4:22 pm

Re: PHPMyEdit: Display Email fields as mailto: links

Post by Pupster »

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
Post Reply