Location: PHPKode > projects > QuickSkin > QuickSkin_v5.0/_lib/qx/qx_mailto.php
<?php
  /**
  * QuickSkin Extension mailto
  * creates Mailto-Link from email address
  *
  * Usage Example:
  * Content:  $template->assign('CONTACT', 'hide@address.com' );
  * Template: Mail to Webmaster: {mailto:CONTACT}
  * Result:   Mail to Webmaster: <a href="mailto:hide@address.com">hide@address.com</a>
  *
  * @author Andy Prevost hide@address.com
  */
  function qx_mailto ( $param,$name='',$encode=false ) {
    if ($encode === false) {
      if ( $name != '' ) {
        return '<a href="mailto:' . $param . '">' . $name . '</a>';
      } else {
        return '<a href="mailto:' . $param . '">' . $param . '</a>';
      }
    } else {
      $obfuscatedMailTo = '';
      $mailto = "mailto:";
      $length = strlen($mailto);
      for ($i = 0; $i < $length; $i++) {
        $obfuscatedMailTo .= "&#" . ord($mailto[$i]);
      }
      $mailto = $param;
      $length = strlen($mailto);
      $param  = '';
      for ($i = 0; $i < $length; $i++) {
        $param .= "&#" . ord($mailto[$i]);
      }
      if ( $name != '' ) {
        $mailto = $name;
        $length = strlen($mailto);
        $name  = '';
        for ($i = 0; $i < $length; $i++) {
          $name .= "&#" . ord($mailto[$i]);
        }
        return '<a href="' . $obfuscatedMailTo . ':' . $param . '">' . $name . '</a>';
      } else {
        return '<a href="' . $obfuscatedMailTo . ':' . $param . '">' . $param . '</a>';
      }

    }
  }

?>
Return current item: QuickSkin