Home > General > Affiliate Marketing Forum

How to create banners that call out city? (17)


06-09-2012 02:48 AM #1 12as26 (Member)
How to create banners that call out city?

How do you make creatives for display call out a particular user's city?

I.e

"1593 Single Girls in [Your Area]"

Where [Your Area] is dynamically replaced by the user's city.

1593 Single Girls in New York City
1593 Single Girls in Dallas
1593 Single Girls in San Diego

etc.

Looking to do this with MaxMind's GeoIP city if possible.


06-09-2012 04:35 AM #2 snarry (Member)

Something i would like to know to.


06-09-2012 04:50 AM #3 mrgodlike (Member)

Flash banners have this capability


06-09-2012 06:25 AM #4 dconstrukt (Member)

flash is the only way...


06-09-2012 09:26 AM #5 aquasun (Member)

with flash cs6 you can export your work to HTML5, basically adobe now will just use the browsers ecmascript instead of the one in the flash runtime. They also got the critical needed components from the library ported over as well.

Within reason, if you make it in flash and export it to HTML5 it should work. Remember though must have the newly released CS6 for this.


06-09-2012 09:27 AM #6 aquasun (Member)

Also you can do it with plain javascript to overlaying the text on the image, many do this. Although the flash way above would get the most polished result.


06-09-2012 11:35 PM #7 snarry (Member)

here is a good example.

danasoft.com
ipnow.org


06-11-2012 02:08 AM #8 snarry (Member)

This seems more like it.



geoplugin.com


06-11-2012 03:49 PM #9 shoent (Member)

if you are using sitescouts adserver or even running on sitescout RTB you can do this thru there platform.


06-12-2012 12:33 AM #10 snarry (Member)

so your able to do this


on sitescout?


And if you wanted to do this your self this was a good read.
gfy.com/showthread.php?t=873995


06-12-2012 02:11 AM #11 shoent (Member)

yes you can do that on sitescout.


06-12-2012 02:52 AM #12 nusolutionz (Veteran Member)

Quote Originally Posted by snarry View Post
so your able to do this


on sitescout?


And if you wanted to do this your self this was a good read.
gfy.com/showthread.php?t=873995
how are you able to show geo informations on a .gif image? i read the gfs thread but i still don't understand how he is doing it..thought it's only possible with flash images


06-12-2012 03:26 AM #13 zeno (Administrator)

Perhaps you could use something like ImageMagick and corresponding PHP wrapper to do this? Shiiiit I remember using it years ago when I played with webdev. So looking it up right now. ** MANY HOURS LATER** Aiiiight so figured some stuff out. First of all you can do it pretty easily with GD, which pretty much everyone will have installed with the PHP, or with ImageMagick+Imagick PHP extension. Little idea on how to deal with animated gifs as of yet but I imagine it's straightforward but with lots of code to write out. I also don't know how to make it load with an image extension rather than php, an issue for later.

Here is a banner I made for y'all using GD:



I used gif mode rather than jpeg because it was giving ugly compression results. Code is as follows:

Code:
<?
$record = geoip_record_by_name( $_SERVER['REMOTE_ADDR'] ); 
$city = $record['city'];
$state = $record['region'];
$text = $city.",".$state."?";

$file = 'test.jpg';
$dim = getimagesize($file);
$imagewidth = $dim[0];
$imageheight = $dim[1];
$image = imagecreatefromjpeg($file);
$textcolor = imagecolorallocate($image, 255, 210, 0);
$shadow = imagecolorallocate($image, 40, 40, 40);
$font = 'arial.ttf';
imagettftext($image, 24, 0, 102, 112, $shadow, $font, $text);
imagettftext($image, 24, 0, 100, 110, $textcolor, $font, $text);
header('Content-type: image/jpg');
imagegif($image);
imagedestroy($image);
?>
Here is what I got using Imagick - you need to get ImageMagick and Imagick installed and working to use this:



Code:
<?php
//gather geoip information
$record = geoip_record_by_name( $_SERVER['REMOTE_ADDR'] ); 
$city = $record['city'];
$state = $record['region'];
//set output text
$text = $city.",".$state."?";
	 
// Create Imagick object
$im = new Imagick( 'test.jpg' );
     
// Create a drawing object and set the font size
$drawshadow = new ImagickDraw();
$drawshadow->setFontSize( 30 );
$drawshadow->setFont( "arial.ttf");
$drawshadow->setFillColor('#1e1e1e');

$draw = new ImagickDraw();
$draw->setFontSize( 30 );
$draw->setFont( "arial.ttf");
$draw->setFillColor('#ffd200');

     
// Write the text on the image
$im->annotateImage( $drawshadow, 102, 112, 0, $text );
$im->annotateImage( $draw, 100, 110, 0, $text );
     
// Output
header( "Content-Type: image/{$im->getImageFormat()}" );
echo $im;
?>
That's my fun for the day. I'm off to drink.


06-12-2012 07:15 AM #14 zeno (Administrator)

Oh, and UPDATED, BOOM!


06-12-2012 08:42 AM #15 aquasun (Member)

Zeno,

To much work. Most of these are done in flash because its easy and you can create a very polished result. I would suggest at least trying that. Remember cs6 you can publish to html5

cheers


06-12-2012 02:44 PM #16 zeno (Administrator)

Ya html5 is definitely the most elegant way to go. The above was more because I wanted to prove to myself I could figure it out. Well, I had a few hours of time to pad out, so yeah.


06-13-2012 02:40 AM #17 exchanger107 (Member)

using the flash cs6 is the best way i think. because it supports HTML and you can import the banner easily.


Home > General > Affiliate Marketing Forum