TinyButStrong Error with plug-in 'TBS_NAVBAR' : no class named 'TBS_NAVBAR' is found, and no function named 'tbspi_TBS_NAVBAR_OnInstall' is found.
MyEmailCloak emailcloak.php
Return to TBS examples
Contacts from your database TBS v3.5.3 -- ezSQL v2.05
[mouseover the email links - click to see the result - view source to see the js bits]
Name eMail Phone
Gossamar, Gary no
 999--555-1234
Graystone, Joey
 not available
Greenleaf, Mike no
 999--555-1234

|< < [nv.page] [nv.page;block=td;currpage] > >|


[How I cloak email addresses coming from a database] Contact Me

Instead of having to do a form-based solution using 'id' numbers to hide email addresses that reside in your database - this solution provides an implementation that does a "mailto:" link with cloaking from within TBS using an 'ondata' PHP function.

A simple link to a form looks like this:

  <a href="/contact.html?id=726" title="Contact Me!">Contact Me!</a>
We're not going to get rid of the current href, so that even if they don't have javascript or an email client on their system, they can still contact you using a contact form (at "/contact.html").
I migrated a cloaking scipt to work as a TBS 'ondata' function - it adds onmouseover and onfocus handlers to change the actual address to the 'real' email address when they interact with it. The output looks like:
  <a href="/contact/" title="Contact Me!"
   onmouseover="javascript:this.href=mailMe('example%23com?subject=TBS cloaking funct','me');"
   onfocus="javascript:this.href=mailMe('example%23com?subject=TBS cloaking funct','me');"
   >Contact Me!</a>
Don't forget to put the little slug of javascript in the top of your template html file.