Advertisement:

Author Topic: [TIPS/GUIDE]Protect phone number to image by product attribute plugin  (Read 5257 times)

texthiller

  • Full Member
  • ***
  • Posts: 207
Protect the telephone number of user in ads by GD library:

1) install products attribue plugin from market
2) create file called image.php in your osclass root folder and add this code:
Code: [Select]
<?php
// Set header to png type
header("Content-type: image/png");

// Get email address to use from URL
if(isset($_GET['email'])) {
  
$email $_GET['email'];
} else {
  
$email "user@example.com";  
}

// Get font size to use from URL
if(isset($_GET['font'])) {
  
$font $_GET['font'];
} else {
  
$font 4;  
}

// Get size of font characters
$fontwidth  imagefontwidth($font);
$fontheight imagefontheight($font);

// Define total size of border around the text
$border_x $fontwidth*3;
$border_y $fontheight;

// Determine size of image
$length =    (strlen($email)*$fontwidth) + $border_x;
$height =    $fontheight $border_y;

// Create image using GD image library
$im = @ImageCreate ($length$height)
    or die (
"Cannot Initialize new GD image stream");

// Set background colour to yellow
$background_color ImageColorAllocate ($im2552550);

// Set text colour to black
$text_color ImageColorAllocate ($im000);

// Write text onto image
imagestring($im$font,($border_x/2),($border_y/2),$email$text_color);

// Generate and output PNG image
imagepng ($im);
?>

3) open item_detail.php in you products plugin folder delete all and add this;
Code: [Select]
            <img src="/image.php?email=<?php echo @$detail['s_make']; ?>" alt="Email Address" /></p>
            <img src="/image.php?email=<?php echo @$detail['s_model']; ?>" alt="Email Address" /></p>

           
           
     

4) done. Your telephone number doesn't appear in google.
Thanks to: http://www.mattsbits.co.uk/item-113.html
« Last Edit: January 22, 2013, 03:17:52 pm by texthiller »

stiffe

  • Full Member
  • ***
  • Posts: 128
Re: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
« Reply #1 on: January 23, 2013, 09:30:18 pm »
Thanks!


This is for email-addresses, and could be really useful, but it does not work here...
« Last Edit: January 23, 2013, 09:32:26 pm by stiffe »

texthiller

  • Full Member
  • ***
  • Posts: 207
Re: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
« Reply #2 on: January 24, 2013, 01:01:48 pm »
Please, explain your problem! Actually there is compatibility problem with Cars Plugin I think that this problem is caused by similar code.

plesk

  • Full Member
  • ***
  • Posts: 188
Re: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
« Reply #3 on: September 02, 2013, 03:14:20 am »
Good evening what place we place this code  thank you

open item_detail.php products in you plugin folder and delete all add this

 
Code: [Select]
<img src = "/ image.php email = <php echo @ $ detail ['s_make'];?>" alt = "Email Address" /> </ p>
             <img src = "/ image.php email = <php echo @ $ detail ['s_model'];?>" alt = "Email Address" /> </ p>

plesk

  • Full Member
  • ***
  • Posts: 188
Re: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
« Reply #4 on: October 24, 2013, 09:06:36 pm »
Hi, the image file is created after I do what I do not understand English very well I french or could you give me a tutorial thank you