BlueShoes Application Framework made with PHP http://www.blueshoes.org/


Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: C:/usr/local/lib/php/blueshoes-4.2/core/net/email/Bs_EmailUtil.class.php
BlueShoes Application Framework - net/email

Bs_EmailUtil

Bs_Object
   |
  +-- Bs_EmailUtil

General pseudo-static email utility class.

 

public class Bs_EmailUtil extends Bs_Object

General pseudo-static email utility class.
features:-missing:-dependencies: Bs_HtmlUtil

Authors
Version4.0.$id$
Copyrightblueshoes.org

 

Methods inherited from Bs_Object

isex, isexception, tostring, tohtml, persist, unpersist, bs_object, bbsetoutput, bbawake, bbisawake, bbxmsg, bbxfunctionstart, bbxfunctionend, bbxecho, bbxvar, bbxvardump, bbforcetrace, bbbufferstart, bbbufferget, bbbufferendflush, bbbufferendclean

Public Method Summary

void

Bs_EmailUtil()

Constructor
array

parse(string $email)

Validates the syntax of a given email address and parses it into it's elements.
string

hideEmailWithJsDocumentWrite(string $email, [ string $name, string $cssClass ])

uses javascripts document.write() function to spit out the address as link.
string

emailHidingWithJsOnMouseOver(string $email)

void

toPronounceable(string $email, [ mixed $lang ])

converts the given email address into a "pronounceable" string.
string

htmlEncode(string $email)

html-encodes the address.

Private Field Summary

object [unknown]

$Bs_HtmlUtil

reference to the pseudo-static instance.

Private Constant Summary

BS_EMAILUTIL_VERSION >>4.0.$x$<< Warning: documentation is missing.

Public Method Details

Bs_EmailUtil

public void Bs_EmailUtil( )

  Constructor

Returns void


parse

public array parse( string $email )

  Validates the syntax of a given email address and parses it into it's elements.

Parameter
string $email
Returns array

a zerobased array. 0=user 1=host

Throws bool FALSE

hideEmailWithJsDocumentWrite

public string hideEmailWithJsDocumentWrite( string $email, [ string $name, string $cssClass ] )

  uses javascripts document.write() function to spit out the address as link.
non-js browsers will see a readable version of the address using the noscripttag.this is browser-safe and emailspider safe.most, like 98% of the web users won't notice a difference, and most, like99.9% of the email spiders won't catch the address. use it!

Parameter
string $email
string $name = >>NULL,<<
(default is NULL, which means use the $email address as 'caption' aswell.)
string $cssClass = >>NULL<<
(if you want to apply a style sheet to the tag.)
Returns string

(html code)

Throws bool FALSE (if the given email address is invalid.)
See Also emailHidingWithJsOnMouseOver()

emailHidingWithJsOnMouseOver

public string emailHidingWithJsOnMouseOver( string $email )

 

Parameter
string $email
Returns string

(html code)

Throws bool FALSE (if the given email address is invalid.)
See Also hideEmailWithJsDocumentWrite()

toPronounceable

public void toPronounceable( string $email, [ mixed $lang ] )

  converts the given email address into a "pronounceable" string.
these languages are supported: (texts are written in lower case here)CHARACTERLANGUAGE @ . _ -'en' at dot underscore dash'de' at punkt unterstrich strich'de2' affenschwanz punkt unterstrich minusyou can pass an array (vector with 4 elements) as param 2 ($lang) to useyour own text. make sure you use a space in front and at the end of thestrings, or feel free to use something else.EXAMPLES: (the results are not html-encoded here for better reading)htmlEncode('tom.jones@hotmail.com') => tom DOT jones AT hotmail DOT comhtmlEncode('tom.jones@hotmail.com', 'de2') => tom PUNKT jones AFFENSCHWANZ hotmail PUNKT com

Parameter
string $email
mixed $lang = >>'en'<<
(default is 'en', see above)
Returns void


htmlEncode

public string htmlEncode( string $email )

  html-encodes the address.
this is just a wrapper for Bs_HtmlUtil->charToHtml().

Parameter
string $email
Returns string


Private Field Details

$Bs_HtmlUtil

private object [unknown] $Bs_HtmlUtil

>><<

reference to the pseudo-static instance.


Private Constant Details

BS_EMAILUTIL_VERSION

define( BS_EMAILUTIL_VERSION, >>4.0.$x$<< )
Case: default: case sensitive




Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta