Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-07 04:41:02

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

spam proof email from custom field

I have an article that uses custom fields for certain data,
and it will need to include an email address entered by a less than tech savvy user.

in other words, I would like the custom field to be filled out : email@domain.com

I am hoping to insert this custom field into a bit of javascript or using php, directly into the <code><txp:email email=”<txp:php>stuff i don’t know how to do</txp:php>”</code> tag.

Anybody have any ideas, or see something I don’t?

Thanks


Offline

#2 2006-06-07 06:57:27

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: spam proof email from custom field

It’s groundhog day tags-in-tags time again. Woohoo!

Matt, try this (most preferably in an article form, or even in a misc form you push through txp:output_form directly in just one article. Depends on your goals):

<txp:php>
$c = custom_field( array("name"=>"address")); # assuming custom field name here!
$a = array("email" => $c, "linktext"=> "link text", "title" => "a humble title" );
echo email ( $a );
</txp:php>

This piece of code assumes that you named your custom field “address” (see # comment above).

Last edited by wet (2006-06-07 06:59:01)

Offline

#3 2006-06-07 18:10:29

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: spam proof email from custom field

Wet,
thanks bro. I’ll give that a go!
One of these days I’m going to strap myself to my chair and start learning the txp php.

:)


Offline

#4 2006-06-07 18:35:41

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: spam proof email from custom field

Avoid this. At any cost. It’ll do you no good.

Offline

#5 2006-06-08 03:59:15

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: spam proof email from custom field

Matthew,

I have been working on a plugin to allow you to pack multiple values into custom fields. Have added a tag to it to allow you to setup an email link from the values of a custom field. Drop me an email via the forum or my contact page if you want an advance copy of it. It should be up on my site within a day or two.

It’s up already at http://txp-plugins.netcarving.com/plugins/

Last edited by net-carver (2006-06-08 04:35:20)


Steve

Offline

#6 2006-06-08 07:05:50

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: spam proof email from custom field

wet,
to the point. maybe just keep pursuing design and css/xhtml huh? or maybe php in general, rather than learning some of the TXP tag php?
where is the motivation behind your comment?

Netcarver,
I’ll check it out, thanks.


Offline

#7 2006-06-08 07:39:26

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,393
Website GitHub Mastodon

Re: spam proof email from custom field

ma_smith wrote:

wet, where is the motivation behind your comment?

  1. Just kidding.
  2. <rant> PHP sucks in various ways, though it’s popular </rant>

Last edited by wet (2006-06-08 07:46:09)

Offline

#8 2006-06-09 12:10:04

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: spam proof email from custom field

Wet,
1. can you say dry.
2. What do you like to write in? Are you using ROR at all?


Offline

Board footer

Powered by FluxBB