You are not logged in. Login or Signup
Home » Messageboard » Message 10175243 (Thread)

# Aw, go on, tell us how you did it!
Pleeeeeeeeeeeese?
(, Fri 3 Sep 2010, 15:25, archived)
#
<?
##
## $Source: ./cr3/moist.jpg,v $
## $Revision: 0.3 $
## $Author: cr3 $
## $Date: 2010/09/03 15:30:00 $
##

include('../../core/init.php');

$un = strtoupper($user[username]);

if ($un == "") {
$un = "YOUR MUM";
}

$image = ImageCreateFromjpeg("template.jpg");
$color = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$colorShadow = imagecolorallocate($image, 0x66, 0x66, 0x66);
$font = 'IMPACT.TTF';
$fontSize = "70";
$fontRotation = "0";
$str = "$un";
$font_width="39";
if (strlen($str) > 15) {
$fontSize = "40";
$font_width = "23";
}


$text_width = $font_width * strlen($str);

$center = (700 / 2) - ($text_width / 2);

/* Shadow */
ImageTTFText($image, $fontSize, $fontRotation, ($center+2), 92, $colorShadow, $font, $str);

/* Top Level */
ImageTTFText($image, $fontSize, $fontRotation, $center, 90, $color, $font, $str);

$fontSize = "70";
$fontRotation = "0";
$str = "MAKES ME MOIST";
$font_width="45";

$text_width = $font_width * strlen($str);

$center = (700 / 2) - ($text_width / 2);

/* Shadow */
ImageTTFText($image, $fontSize, $fontRotation, ($center+2), 532, $colorShadow, $font, $str);

/* Top Level */
ImageTTFText($image, $fontSize, $fontRotation, $center, 530, $color, $font, $str);

header("Content-Type: image/jpeg");
Imagejpeg ($image);
imagedestroy($image);

?>
(, Fri 3 Sep 2010, 15:30, archived)
# *worships*
(, Fri 3 Sep 2010, 15:31, archived)
# well, you asked
(, Fri 3 Sep 2010, 15:33, archived)
# Aww man, you're cheating, we don't have access to the $user array to make that sort of thing.
I didn't notice it was on the b3ta domain for all the session/cookie stuff.

*Demands an API so I can make cool shit too*
(, Fri 3 Sep 2010, 15:41, archived)
# haha, never
(, Fri 3 Sep 2010, 15:41, archived)
# SAD TIMES
(, Fri 3 Sep 2010, 15:58, archived)