1
KubaZ
Email protection hack in userinfo.php
  • 2005/5/30 12:25

  • KubaZ

  • Just popping in

  • Posts: 37

  • Since: 2002/10/9


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:
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 :

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''&nbsp;');
        }
    }
}


(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)

2
philou
Re: Email protection hack in userinfo.php
  • 2006/9/3 4:33

  • philou

  • Quite a regular

  • Posts: 384

  • Since: 2002/5/6 8


very good... but the link is dead for download the emailprotector.php

do you know where we can find it ???
Resized Image - - Resized Image

3
Rapor
Re: Email protection hack in userinfo.php
  • 2006/9/3 7:24

  • Rapor

  • Just popping in

  • Posts: 26

  • Since: 2006/5/29


Download Error

[Error : Błąd]

[404] File Not Found : Plik nie istnieje

.Rar ?

4
KubaZ
Re: Email protection hack in userinfo.php
  • 2007/3/12 11:40

  • KubaZ

  • Just popping in

  • Posts: 37

  • Since: 2002/10/9


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

Login

Who's Online

140 user(s) are online (75 user(s) are browsing Support Forums)


Members: 0


Guests: 140


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits