Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Email, MSN and Yahoo adresses as GD Images Details »»
Email, MSN and Yahoo adresses as GD Images
Version: 1.00, by corn corn is offline
Developer Last Online: Jun 2012 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 06-14-2005 Last Update: Never Installs: 3
 
No support by the author.

First of all, I'm not sure if this is a hack or a template mod.
so, if its placed wrong, please advise.
this is my first 'hack', so be nice

My forum members were complaining about the load of spam they received after the emailaddresses were publicly viewable.
We wouldn't use the secure mail function, because the users wanted to see eachothers mail addresses.


Installation:
Create a file called email.php.
It must contain the following lines of code:
Code:
<?php
  header("Content-type: image/png");

########## Email, MSN and Yahoo adresses as GD Images ############
########## Made by Corn for vb.org ##########

  $im     = imagecreatefrompng("email.png");
  $color  = imagecolorallocate($im, 0, 0, 0);
  $px     = (imagesx($im) - 7.5 * strlen($user)) / 2;
  imagestring($im, 4, $px, 1, $user, $color);
  imagepng($im);
  imagedestroy($im);
?>
or use the one attached.

in the attached .zip, you can find a email.png file.
put the files in your forum root dir.

Go to the AdminCP and open the MEMBERINFO template, and search for
Code:
$userinfo[msn]
replace that with
Code:
<img src="email.php?user=$userinfo[msn]" border="0">
also in the MEMBERINFO template, search for
Code:
$userinfo[yahoo]
replace that with
Code:
<img src="email.php?user=$userinfo[yahoo]" border="0">
Go to the Phrase manager, and search for showemail variable.
you will find the following:
Code:
The email address for $destusername is <a href="mailto:$email">$email</a>
replace with:
Code:
The email address for $destusername is <a href="mailto:$email"><img src="email.php?user=$email" border="0"></a>
thats all

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 06-15-2005, 11:18 AM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
First of all, I'm not sure if this is a hack or a template mod.
so, if its placed wrong, please advise.
this is my first 'hack', so be nice
This is a hack, and a very good one :up:
Reply With Quote
  #3  
Old 06-15-2005, 11:26 AM
cinq's Avatar
cinq cinq is offline
 
Join Date: Oct 2002
Posts: 1,398
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Was trying to do this a while back

Good job
You can probably apply this to any email address posted as well by amending the functions_bbcode.php in your includes folder.
Reply With Quote
  #4  
Old 06-15-2005, 11:49 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IMHO this does not make much sense, as the eMail address is still in the HTML and can be processed automatically by spammers.
If you really want to do this (which isn't worth it) you might want to use smth. like the attached script.
Reply With Quote
  #5  
Old 06-15-2005, 12:37 PM
jugo jugo is offline
 
Join Date: Feb 2004
Location: Reading your emails.
Posts: 573
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice Kirby.
Reply With Quote
  #6  
Old 06-15-2005, 01:03 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
If you really want to do this (which isn't worth it) you might want to use smth. like the attached script.
I think obfuscating emails is really worth it, if that's what you meant?

And as always, great job with the code recommendations :up:

One issue, I think, that might be a problem with both versions is the image caching. As it's called email.png and browsers will often cache this, and one will end up sending emails to the wrong members

I'd call the image something like this,
PHP Code:
  $im     imagecreatefrompng('email-' $userinfo['userid']  . '.png'); 
or with a random string as a cache buster.
Reply With Quote
  #7  
Old 06-15-2005, 01:21 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
I think obfuscating emails is really worth it, if that's what you meant?
I meant that, but as said it's IMHO not worth it the processing overhead, aus you can simply turn off displaying eMails.

Quote:
I'd call the image something like this,
PHP Code:
  $im     imagecreatefrompng('email-' $userinfo['userid']  . '.png'); 
Erm ... for this to work you would need tohse image-userid.png files on your servers HD
The users browser never gets to see this email.png, however if you want to prevent caching (which should only be an issue when a user changes his eMail) you can add No-Cache Headers.
Reply With Quote
  #8  
Old 06-15-2005, 02:19 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
I meant that, but as said it's IMHO not worth it the processing overhead, aus you can simply turn off displaying eMails.
That won't work, as it would fail the original requirement

Quote:
My forum members were complaining about the load of spam they received after the emailaddresses were publicly viewable.
We wouldn't use the secure mail function, because the users wanted to see eachothers mail addresses.
Quote:
Erm ... for this to work you would need tohse image-userid.png files on your servers HD
The users browser never gets to see this email.png, however if you want to prevent caching (which should only be an issue when a user changes his eMail) you can add No-Cache Headers.
What would be best, IMHO, and eliminate some of the overhead, is to be able to generate the image without calling a new php file.

Is this doable? Can it be done in a plugin through a hook? And be able to show the image on the fly?
Reply With Quote
  #9  
Old 06-15-2005, 02:23 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the vB 3.0.x section, so there are no Plugins/Hooks

Well, doing this without creating the images on the fly means you must create them when the user enters/changes his emai/msn/yahoo - and store them somewhere for later retrival (either in the database or on disk).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:32 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06046 seconds
  • Memory Usage 2,298KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_code
  • (2)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete