[pmwiki-users] How to create a link?
Joachim Durchholz
jo at durchholz.org
Fri May 6 15:11:34 CDT 2005
I just found another way to achieve what I want, but I need some extra
information to actually use that approach.
Ultimately, I want to rewrite any mailto: URLs so that they point to a
http page with a mail form. I just recalled the $LinkFunctions array,
which would be perfect for that purpose.
My idea looks roughly like this:
$LinkFunctions['mailto:'] := 'MailProtectLinkFunction';
MailProtectLinkFunction($pagename, $imap, $path, $title, $txt, $fmt) {
... store $path in the $_SESSION['mailprotect'] array
Call what was stored in $LinkFunctions['mailto:'] before,
with the following parameters:
$pagename = $pagename
$imap = 'http:'
$path =
<PmWiki script URL>
. 'MailForm?id=' . count($_SESSION['mailprotect'])
$title = '' (no titles)
$txt = 'Send mail'
$fmt = $fmt
}
Questions:
1) Is this viable? Any pitfalls?
2) What's the best way to construct that <PmWiki script URL>? Simply use
$ScriptUrl?
Regards,
Jo
More information about the pmwiki-users
mailing list