Last active
December 1, 2018 15:28
-
-
Save lawebfabric/8ce1c1f3df76dbc6cf614f05fd929d67 to your computer and use it in GitHub Desktop.
email obfuscator for MODX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//----------------------------------------------------------- | |
// emailPrefix | |
//----------------------------------------------------------- | |
/* | |
* @author: Steeve from lawebfabric | |
* @website: http://www.lawebfabric.com | |
* @tutorial modx website: http://www.tutocms.fr/ | |
*/ | |
/* | |
* | |
* Usage : [[++contact_email:emailPrefix]] or [[*myEmailTv:emailPrefix]] | |
* <span class="mel" data-user="[[++contact_email:emailPrefix]]" data-website="[[++contact_email:emailSuffix]]"></span> | |
* | |
*/ | |
$emailPrefix = substr ($input, 0, strrpos ($input, '@')); | |
return $emailPrefix; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//----------------------------------------------------------- | |
// emailSuffix | |
//----------------------------------------------------------- | |
/* | |
* @author: Steeve from lawebfabric | |
* @website: http://www.lawebfabric.com | |
* @tutorial modx website: http://www.tutocms.fr/ | |
*/ | |
/* | |
* | |
* Usage : [[++contact_email:emailSuffix]] or [[*myEmailTv:emailSuffix]] | |
* <span class="mel" data-user="[[++contact_email:emailPrefix]]" data-website="[[++contact_email:emailSuffix]]"></span> | |
* | |
*/ | |
$emailSuffix = substr (strstr ($input, '@'), 1); | |
return $emailSuffix; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* needed css style for working */ | |
.mel::before { | |
content: attr(data-user) "@" attr(data-website); | |
unicode-bidi: bidi-override; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment