Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
mailto
Hi there,
I’m having problems with a particular installation of textpattern. For some reason Myres Castle won’t let me use mailto in a textile link.
For example:
<pre>This is my link;
Gives me http://www.myrescastle.com/mailto:email@email.com rather then just mailto:email@email.com
Strange thing is, if I put:
<pre>link;
It picks up that its a mailto, but obviously includes the two // with the email address.
Can anybody shed any light on this?
—-
Thought I’d post my .htaccess file just encase its something todo with URL handling:
<pre>
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]
RewriteRule ^(.*) /index.php </IfModule>#php_value register_globals 0
</pre>
Offline
Re: mailto
Most people don’t just post email addresses (especially if they’re using textile…)
I’m pretty certain textile doesn’t work on this ever.
Try this function:
<code>
function safeAddress($emailAddress, $theText, $theTitle, $xhtml, $isItSafe=”“)
{
$ent = “”;
$userName = “”;
$domainName = “”;
for ($i = 0; $i < strlen($emailAddress); $i++)
{
$c = substr($emailAddress, $i, 1);
if ($c "@")
{
$userName = $ent;
$ent = "";
}
else
{
$ent .= "&#" . ord($c) . ";";
}
}
$domainName = $ent;
if ($xhtml 1) {
$endResult = “<script type=\“text/javascript\”>
<!—
document.write(‘<a href=\“mailto:$userName@$domainName\” title=\”$theTitle\”>$userName@$domainName<\/a>’);
// —>
</script>”;
} else {
$endResult = “<script language=\“JavaScript\” type=\“text/javascript\”>
<!—
document.write(‘<a href=\“mailto:$userName@$domainName\” title=\”$theTitle\”>$userName@$domainName<\/a>’);
// —>
</script>”;
}
if ($isItSafe) {
return(htmlentities($endResult));
} else {
return($endResult);
}
}
</code>
or go to Automatic Labs for the Enkoder.
Last edited by Walker (2006-07-25 19:12:47)
Offline
Re: mailto
Hi Walker,
Thanks for your post.
I’m really confused now. My splash page at www.jonleverrier.com uses a textile mailto and it works fine, just not on Myres Castle.
This function looks interesting – what do i do with it?
Cheers,
Warmbeat
Offline
Re: mailto
You might also consider the use of txp:email.
Online
Re: mailto
Thanks for the info wet.
In addition to my previous post – could any body tell me why one method would work on one textpattern installation to another?
Offline
Re: mailto
Hi Walker – any further feedback?
Anybody else got any help or suggestions?
Rgds,
Warmbeat
Offline