Welcome Guest [Log In] [Register]
This board has been archived and is no longer accepting new questions. If you have a support question for your ZetaBoard, please visit us at the new support board. Registration is free and easy.


Visit the NEW ZetaBoards Support forum!

Username:   Password:
Add Reply
Encrypt Emails; Stops bots from stealing your emails
Topic Started: Aug 5 2008, 12:29 PM (599 Views)
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
What it does: Webpage to encrypt the email addresses using ROT13, and is only decrypted when a user clicks the email link.
Where it goes: 2 different codes (explained further down)
Browsers: FF3.0 · Opera 9 · IE 7 · IE 8 · Safari 3
Code:

This code goes Below the board / Above Copyright

Code: HTML
 
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
function decipher(str){
var alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM";
var beta = "";
for(var i=0;i<str.length;i++){
if(str.charAt(i)=="@"){beta+="@";}
else if(str.charAt(i)=="."){beta+=".";}
else {beta += alpha.charAt(alpha.indexOf(str.charAt(i))+13);}}
return beta.toLowerCase();}
var anchor = $("a");
for(i=0;i<anchor.length;i++){
if(anchor[i].href.match(/contact\/(.*)/i)){
anchor[i].onclick = function(){location.href="mailto:"+decipher(RegExp.$1.toUpperCase());return false;}}}});
//]]>
</script>


Make a new webpage, title "email", id "email". Paste this into the box:

Code: HTML
 
<div style="float:left;width:48%;text-align:center;"><textarea id="oT" onfocus="this.value=''">Email Address Here</textarea></div><div style="float:right;width:48%;text-align:center;"><textarea id="tT">Encrypted URL Here</textarea></div>

<br /><br /><br /><br /><br /><br />

<div style="text-align:center"><input type="button" id="enc" value="Encrypt"/></div>

<script>
function decipher(str){
var alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM";
var beta = "";
for(var i=0;i<str.length;i++){
if(str.charAt(i)=="@")beta+="@";
else if(str.charAt(i)==".")beta+=".";
else beta += alpha.charAt(alpha.indexOf(str.charAt(i))+13);}
return beta.toLowerCase();}
document.getElementById("oT").value="Email Address Here";
document.getElementById("tT").value="Encrypted URL Here";
document.getElementById("enc").onclick=function(){
document.getElementById("tT").value="http://contact/"+decipher(document.getElementById("oT").value.toUpperCase());}
</script>


What to do: If you or a member wants to post or display an email link, go to the newly created webpage. Type in the email and click encrypt. Copy the encrypted URL, and that's the URL you use for that Email.

Note:

Preview: http://s1.zetaboards.com/viralajax/topic/513965/1/
Offline Profile Quote Post Goto Top
 
HaX3
Member Avatar
Member
[ *  * ]
Thanks Viral Illl use this.
Offline Profile Quote Post Goto Top
 
choco
SPORE
[ *  *  * ]
It'd be a bit, in fact, a LOT more intuitive if you hijacked the email bbcode button and rot13'd it there instead of requiring the admin to get hosting and so on. ;)
Offline Profile Quote Post Goto Top
 
Viral
Member Avatar
i'm stanley nao
[ *  *  *  *  * ]
Why would the admin need to get hosting?
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · User Created Codes · Next Topic »
Add Reply