Osclass forums
Support forums => Tips, tricks, and tutorials => Topic started 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:
<?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 ($im, 255, 255, 0);
// Set text colour to black
$text_color = ImageColorAllocate ($im, 0, 0, 0);
// 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;
<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
-
Thanks!
This is for email-addresses, and could be really useful, but it does not work here...
-
Please, explain your problem! Actually there is compatibility problem with Cars Plugin I think that this problem is caused by similar code.
-
Good evening what place we place this code thank you
open item_detail.php products in you plugin folder and delete all add this
<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>
-
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