本文整理汇总了PHP中_recaptcha_mailhide_email_parts函数的典型用法代码示例。如果您正苦于以下问题:PHP _recaptcha_mailhide_email_parts函数的具体用法?PHP _recaptcha_mailhide_email_parts怎么用?PHP _recaptcha_mailhide_email_parts使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_recaptcha_mailhide_email_parts函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replace_plaintext
function replace_plaintext($matches)
{
if ($this->options['replace_link_with'] == "" && $this->options['replace_title_with'] == "") {
// find plain text emails and hide them
$html = recaptcha_mailhide_html($this->options['public_key'], $this->options['private_key'], $matches[0]);
} else {
// replace both things
if ($this->options['replace_link_with'] != "" && $this->options['replace_title_with'] != "") {
$url = recaptcha_mailhide_url($this->options['public_key'], $this->options['private_key'], $matches[0]);
$html = "<a href='" . htmlentities($url, ENT_QUOTES) . "' onclick=\"window.open('" . htmlentities($url, ENT_QUOTES) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"" . $this->options['replace_title_with'] . "\">" . $this->options['replace_link_with'] . "</a>";
} else {
if ($this->options['replace_link_with'] != "" && $this->options['replace_title_with'] == "") {
$url = recaptcha_mailhide_url($this->options['public_key'], $this->options['private_key'], $matches[0]);
$html = "<a href='" . htmlentities($url, ENT_QUOTES) . "' onclick=\"window.open('" . htmlentities($url, ENT_QUOTES) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">" . $this->options['replace_link_with'] . "</a>";
} else {
if ($this->options['replace_link_with'] == "" && $this->options['replace_title_with'] != "") {
$url = recaptcha_mailhide_url($this->options['public_key'], $this->options['private_key'], $matches[0]);
$emailparts = _recaptcha_mailhide_email_parts($matches[0]);
$html = htmlentities($emailparts[0], ENT_QUOTES) . "<a href='" . htmlentities($url, ENT_QUOTES) . "' onclick=\"window.open('" . htmlentities($url, ENT_QUOTES) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"" . $recaptcha_opt['replace_title_with'] . "\">...</a>@" . htmlentities($emailparts[0], ENT_QUOTES);
}
}
}
}
// style it
$html = '<span class="mh-email">' . $html . "</span>";
return $html;
}
示例2: recaptcha_mailhide_html
/**
* Gets html to display an email address given a public an private key.
* to get a key, go to:
*
* http://www.google.com/recaptcha/mailhide/apikey
*/
function recaptcha_mailhide_html($pubkey, $privkey, $email)
{
$emailparts = _recaptcha_mailhide_email_parts($email);
$url = recaptcha_mailhide_url($pubkey, $privkey, $email);
return htmlentities($emailparts[0]) . "<a href='" . htmlentities($url) . "' onclick=\"window.open('" . htmlentities($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities($emailparts[1]);
}
示例3: recaptcha_mailhide_html
/**
* Gets html to display an email address given a public an private key.
* to get a key, go to:
*
* http://www.google.com/recaptcha/mailhide/apikey
*/
function recaptcha_mailhide_html($pubkey, $privkey, $email)
{
if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
return "To use reCAPTCHA Mailhide, you have to sign up for a public and private key, you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>";
}
if (!function_exists("mcrypt_encrypt")) {
return "To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.";
}
$emailparts = _recaptcha_mailhide_email_parts($email);
$url = recaptcha_mailhide_url($pubkey, $privkey, $email);
return htmlentities($emailparts[0]) . "<a href='" . htmlentities($url) . "' onclick=\"window.open('" . htmlentities($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities($emailparts[1]);
}
示例4: recaptcha_mailhide_html
/**
* Gets html to display an email address given a public an private key.
* to get a key, go to:
*
* http://mailhide.recaptcha.net/apikey
*/
function recaptcha_mailhide_html($pubkey, $privkey, $email, $html) {
// pro memoria : $html = array($id, $title, $target, $classification, $hreflang, $content);
if(strlen($html[0]) > 0)
{
$id = $html[0];
}
$title = 'Reveal this e-mail address';
if(strlen($html[1]) > 0)
{
$title = $html[1];
}
if(strlen($html[2]) > 0)
{
$target = $html[2];
}
if(strlen($html[3]) > 0)
{
$cssclass = $html[3];
}
if(strlen($html[4]) > 0)
{
$hreflang = $html[4];
}
if(strlen($html[5]) > 0)
{
$content = $html[5];
}
$url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
if( !filter_var($content, FILTER_VALIDATE_EMAIL)) // using php >= 5.2, makes sure it's not an email
{
$parts[0] = $content; // raw link label from content text
$html = '';
}
else
{
$parts = _recaptcha_mailhide_email_parts ($email);
$html = htmlentities($parts[0]);
}
$html .= "<a ";
if(isset($id))
{
$html .= "id='" . $id . "' ";
}
if(isset($cssclass))
{
$html .= "class='" . $cssclass . "' ";
}
if(isset($target))
{
$html .= "target='" . $target . "' ";
}
if(isset($hreflang))
{
$html .= "hreflang='" . $hreflang . "' ";
}
$html .= "href='" . htmlentities ($url). "' ";
$html .= "onclick=\"window.open('" . htmlentities ($url) . "', '', ";
$html .= "'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" ";
// if link label is an email
if(count($parts) > 1)
{
$html .= "title=\"" . $title . "\">...</a>";
$html .= '@' . htmlentities ($parts[1]);
}
else
{
$html .= "title=\"" . $title . "\">". $parts[0] . "</a>"; // raw link label from content text
}
return $html;
}
示例5: recaptcha_mailhide_html
/**
* Gets html to display an email address given a public an private key.
* to get a key, go to:
*
* http://mailhide.recaptcha.net/apikey
*/
function recaptcha_mailhide_html($pubkey, $privkey, $email)
{
$emailparts = _recaptcha_mailhide_email_parts($email);
$url = recaptcha_mailhide_url($pubkey, $privkey, $email);
return htmlentities($emailparts[0]) . '<a href="' . htmlentities($url) . '" onclick="window.open("' . htmlentities($url) . '", "", "toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300"); return false;" title="Reveal this e-mail address">...</a>@' . htmlentities($emailparts[1]);
}