een door php generated picture screenen
Thx in advance
Hiermee kan je plaatjes maken en bewerken.
http://www.phphulp.nl/php/scripts/1/138
Pas het script ff aan en klaar :)
Pas het script ff aan en klaar :)
<br />
<b>Fatal error</b>: Call to undefined function: imagettfbbox() in <b>c:\inetpub\wwwroot\ppicture.php</b> on line <b>27</b><br />
en dit is mijn script nu:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
$uid = $_GET["id"];
require ("dbconnect.php");
$get_userinfo = mysql_query("SELECT * FROM users WHERE id = '$uid'");
while (list($id, $user, $pass, $email, $etype, $race, $gender, $date, $ldatel, $active, $admin, $gold, $iron, $uranium, $ships1, $ships2, $ships3, $ships4, $ships5, $ships6, $weapons1, $weapons2, $weapons3, $weapons4, $weapons5, $weapons6, $defense1, $defense2, $defense3, $defense4, $defense5, $defense6, $miner1, $miner2, $miner3, $miner4, $miner5, $miner6, $miner7, $miner8, $miner9, $derrick1, $derrick2, $derrick3, $derrick4, $derrick5, $derrick6, $silos1, $silos2, $silos3, $silos4, $silos5, $silos6, $silos7, $silos8, $silos9, $votes, $refer, $rtv, $rtr, $referip, $pptext
) =
mysql_fetch_row($get_userinfo)){
if ($race == "humans"){
$font = "#66FF66";
}elseif ($race == "futtons"){
$font = "#FF9900";
}elseif ($race == "tepions"){
$font = "#3399FF";
}elseif ($race == "quyty"){
$font = "#FFFFCC";
}
$get_userplanet = mysql_query("SELECT * FROM planets WHERE owner = '$user'");
$planet = mysql_num_rows($get_userplanet);
// Send png image header
header("Content-Type: image/png");
// Set vars
$text = $pptext;
// Calc the text size
$box = ImageTTFbbox('11.5px', '0', 'font/tahoma.ttf', $text);
// Calc some props for the image
$width = $box[2] - $box[0];
$height = $box[1] - $box[7];
// 10 px empty space on each side
$imagewidth = $width + 30;
$imageheight = $height + 20;
// Create the image
$pic = ImageCreate($imagewidth, $imageheight);
// Set the fontstart positions
$xstart = 10;
$ystart = $imageheight - 10;
// Write the text
ImageTTFText($pic, '11.5px', '0', $xstart, $ystart, $font, 'font/tahoma.ttf', $text);
// Finish image
ImagePng($pic);
// Clean up memory
ImageDestroy($pic);
}
?>
$uid = $_GET["id"];
require ("dbconnect.php");
$get_userinfo = mysql_query("SELECT * FROM users WHERE id = '$uid'");
while (list($id, $user, $pass, $email, $etype, $race, $gender, $date, $ldatel, $active, $admin, $gold, $iron, $uranium, $ships1, $ships2, $ships3, $ships4, $ships5, $ships6, $weapons1, $weapons2, $weapons3, $weapons4, $weapons5, $weapons6, $defense1, $defense2, $defense3, $defense4, $defense5, $defense6, $miner1, $miner2, $miner3, $miner4, $miner5, $miner6, $miner7, $miner8, $miner9, $derrick1, $derrick2, $derrick3, $derrick4, $derrick5, $derrick6, $silos1, $silos2, $silos3, $silos4, $silos5, $silos6, $silos7, $silos8, $silos9, $votes, $refer, $rtv, $rtr, $referip, $pptext
) =
mysql_fetch_row($get_userinfo)){
if ($race == "humans"){
$font = "#66FF66";
}elseif ($race == "futtons"){
$font = "#FF9900";
}elseif ($race == "tepions"){
$font = "#3399FF";
}elseif ($race == "quyty"){
$font = "#FFFFCC";
}
$get_userplanet = mysql_query("SELECT * FROM planets WHERE owner = '$user'");
$planet = mysql_num_rows($get_userplanet);
// Send png image header
header("Content-Type: image/png");
// Set vars
$text = $pptext;
// Calc the text size
$box = ImageTTFbbox('11.5px', '0', 'font/tahoma.ttf', $text);
// Calc some props for the image
$width = $box[2] - $box[0];
$height = $box[1] - $box[7];
// 10 px empty space on each side
$imagewidth = $width + 30;
$imageheight = $height + 20;
// Create the image
$pic = ImageCreate($imagewidth, $imageheight);
// Set the fontstart positions
$xstart = 10;
$ystart = $imageheight - 10;
// Write the text
ImageTTFText($pic, '11.5px', '0', $xstart, $ystart, $font, 'font/tahoma.ttf', $text);
// Finish image
ImagePng($pic);
// Clean up memory
ImageDestroy($pic);
}
?>
komt dit omdat ik geen gd heb geinstalleerd of heb je dat altijd?
Op de concurenten website http://www.phpfreakz.nl staat hoe het moet :)
oh k thx