Osclass forums

Support forums => Tips, tricks, and tutorials => Topic started by: texthiller on January 21, 2013, 06:40:27 pm

Title: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
Post by: texthiller on January 21, 2013, 06:40:27 pm
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
Title: Re: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
Post by: stiffe 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...
Title: Re: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
Post by: texthiller 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.
Title: Re: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
Post by: plesk 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>
Title: Re: [TIPS/GUIDE]Protect phone number to image by product attribute plugin
Post by: plesk 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