| Re: Email protection hack in userinfo.php |
| by KubaZ on 2007/3/12 11:40:10 Hi, today I got a message that link is dead. Apparently I deleted this because I didnt use XOOPS for a long time. I will try to repair link, and post a message on forum. Edit: link works Cheers KubaZ |
| Re: Email protection hack in userinfo.php |
| by Rapor on 2006/9/3 7:24:42 Download Error [Error : Błąd] [404] File Not Found : Plik nie istnieje .Rar ? |
| Re: Email protection hack in userinfo.php |
| by philou on 2006/9/3 4:33:03 very good... but the link is dead for download the emailprotector.php do you know where we can find it ??? |
| Email protection hack in userinfo.php |
| by KubaZ on 2005/5/30 12:25:35 Hi XOOPS World :) Few days ago I read in polish magazine the way of protecting emails, simply create image with email address and spam robot's will be unable to read our addresses :) I've made a little hack to use this protection in my XOOPS service. DEMO: http://www.kongresruchow.pl/userinfo.php?uid=1 LINK: http://www.kongresruchow.pl/kuba/xoops/emailprotection.tgz (200kb) files: [new] ./emailprotection.php [new] ./include/arial.ttf [need to change] ./userinfo.php requirements: GD library Your famous font (I've put only arial.ttf )To run this hack you will have to change userinfo.php so Find this code: le="color: #000000"><?php if ($thisUser->getVar('user_viewemail') == 1) { $xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E')); } else { if (is_object($xoopsUser)) { // All admins will be allowed to see emails, even those that are not allowed to edit users (I think it's ok like this) if ($xoopsUserIsAdmin || ($xoopsUser->getVar("uid") == $thisUser->getVar("uid"))) { $xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E')); } else { $xoopsTpl->assign('user_email', ' '); } } } and change it into : le="color: #000000"><?php if ($thisUser->getVar('user_viewemail') == 1) { $protectedEmail = '<img src="'.XOOPS_URL.'/emailprotection.php?uid='.$thisUser->getVar("uid").'">'; $xoopsTpl->assign('user_email', $protectedEmail); } else { if (is_object($xoopsUser)) { // All admins will be allowed to see emails, even those that are not allowed to edit users (I think it's ok like this) if ($xoopsUser->isAdmin() || ($xoopsUser->getVar("uid") == $thisUser->getVar("uid"))) { $protectedEmail = '<img src="'.XOOPS_URL.'/emailprotection.php?uid='.$thisUser->getVar("uid").'">'; $xoopsTpl->assign('user_email', $protectedEmail); } else { $xoopsTpl->assign('user_email', ' '); } } } (explanation: as you can see, I added one new line $protectedEmail = '<img src="'.XOOPS_URL.'/emailprotection.php?uid='.$thisUser->getVar("uid").'">'; which call our script file 'emailprotected.php' and change $xoopsTpl->assign('user_email', $thisUser->getVar('email', 'E')); to $xoopsTpl->assign('user_email', $protectedEmail); to display image TIPS: You can look into emailprotection.php if you want change color of font, size, etc. And finally the link ! : http://www.kongresruchow.pl/kuba/xoops/emailprotection.tgz (200kb) It weight so much because of size of Arial.tff (stupid MS font) |