Services_ReCaptcha
[ class tree: Services_ReCaptcha ] [ index: Services_ReCaptcha ] [ all elements ]

Class: Services_ReCaptcha_MailHide

Source Location: /Services_ReCaptcha-1.0.3/Services/ReCaptcha/MailHide.php

Class Overview

Services_ReCaptcha_Base
   |
   --Services_ReCaptcha_MailHide

PHP5 interface to the reCATCHA MailHide API.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2008-2009 David Jean Louis

Variables

Methods


Inherited Variables

Inherited Methods

Class: Services_ReCaptcha_Base

Services_ReCaptcha_Base::__construct()
Constructor, you must pass a valid public and private API key, and optionnaly an array of options.
Services_ReCaptcha_Base::getHTML()
Returns the corresponding HTML code.
Services_ReCaptcha_Base::getOption()
Returns an option from Services_ReCaptcha::$options.
Services_ReCaptcha_Base::getOptions()
Returns the Services_ReCaptcha::$options array.
Services_ReCaptcha_Base::setOption()
Sets an option in Services_ReCaptcha::$options and returns the current Services_ReCaptcha_Base instance.
Services_ReCaptcha_Base::setOptions()
Sets a number of options at once in Services_ReCaptcha::$options and returns the current Services_ReCaptcha_Base instance.
Services_ReCaptcha_Base::__toString()
Returns the corresponding HTML code, this is a "magic" shortcut to the getHTML() method.

Class Details

[line 54]
PHP5 interface to the reCATCHA MailHide API.

reCAPTCHA Mailhide helps you protect your inbox by asking people to solve a reCAPTCHA before they can view your email address.

To obtain an encryption key, you can go to the key generation service. This will compute a "public key", which much like a username identifies who you are to the MailHide server, and a "private key" which allows you to encrypt email addresses.



[ Top ]


Class Variables

$apiURL =  'http://mailhide.recaptcha.net/d'

[line 63]

Url of the reCATCHA MailHide API.
  • Access: public

Type:   string
Overrides:   Array


[ Top ]

$email =

[line 98]

The email address you want to "hide".

Type:   string


[ Top ]

$options = array(
        'mask_text'    => '...',
        'link_text'    => null,
        'link_title'   => 'Reveal this e-mail address',
        'popup_width'  => 500,
        'popup_height' => 300,
    )

[line 83]

Options to customize the apparence of the generated HTML and the corresponding popup window.

Available options are:

  • mask_text: string, the chars that will be displayed in the email address to mask it;
  • link_text: string, the text of the link;
  • link_title: string, the title (tooltip) of the link;
  • popup_width: integer, the popup width in pixels;
  • popup_height: integer, the popup height in pixels.


Type:   array
Overrides:   Array


[ Top ]



Method Detail

__construct (Constructor)   [line 118]

void __construct( string $pubKey, string $privKey, [string $email = null], [array $options = array()])

Constructor, you must pass a valid public and private API key.

Additionally, you can pass the email you want to hide, and an array of options.


Overrides Services_ReCaptcha_Base::__construct() (Constructor, you must pass a valid public and private API key, and optionnaly an array of options.)

Parameters:

string   $pubKey   —  The public API key (mandatory)
string   $privKey   —  The private API key (mandatory)
string   $email   —  The email to hide (optional)
array   $options   —  An array of options (optional)

[ Top ]

getEmail   [line 231]

string getEmail( )

Returns the email to "hide".

[ Top ]

getHTML   [line 184]

string getHTML( )

Returns the HTML code snippet that will hide your email.

Instead of this method you can use the __toString() magic method to get the HTML code, for example:

  1.  require_once 'Services/ReCaptcha/MailHide.php';
  2.  
  3.  $mailhide = new Services_ReCaptcha_MailHide(
  4.      'pubkey',
  5.      'privkey',
  6.      'foo@example.com'
  7.  );
  8.  // both are equivalents:
  9.  $html $mailhide->getHTML();
  10.  $html = (string) $mailhide;


Overrides Services_ReCaptcha_Base::getHTML() (Returns the corresponding HTML code.)
[ Top ]

getURL   [line 139]

string getURL( )

Returns the URL of the mailhide popup.
  • Return: The mailhide popup URL
  • Access: public

[ Top ]

setEmail   [line 248]

Services_ReCaptcha_MailHide setEmail( string $email)

Sets the email to "hide" and returns the current Services_ReCaptcha_MailHide instance.

Parameters:

string   $email   —  The email to hide

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:43:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.