Yo tweakertjes
,
Om maar direct met de deur in huis te vallen:
Ik heb een livestream lopen.
Nou allemaal heel leuk
Nu heb ik een script die het lopende nummer uit de database haalt en dan in een PHP PNG script gooit.
Nou wil ik graag dat ik op een of andere manier van dit PNGtje die je dus aanroept als x.php een JPG of wat anders maken zodat ik dus rechtstreeks een JPG of wat anders aanroep.
Ik heb al es zitten stoeien en de verschillende functies op php.net bekeken maar kom er niet echt uit.
Iemand een oplossing voor mij of een voorzetje?
BTW
Ik ben slecht in PHP
oftewel weinig kennis
Om maar direct met de deur in huis te vallen:
Ik heb een livestream lopen.
Nou allemaal heel leuk
Nu heb ik een script die het lopende nummer uit de database haalt en dan in een PHP PNG script gooit.
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
| <?php // Set the header type header("Content-Type: image/png"); // Require the database configuration code require("config.php"); // Exercise the select statement to get what is currently playing $db->open("SELECT songlist.artist, songlist.title FROM songlist, historylist WHERE historylist.songID = songlist.ID ORDER BY historylist.date_played DESC LIMIT 1"); // Populate the song variable with the result $song = $db->row(); // Build the artist, album, song strings $nowplaying = "Now Playing on DJ RammY's ShoutServ:"; $artistString = "" .$song['artist']; $songString = "".$song['title']; // Initialize the length $maxStringSize = 30; // Bubble the longest string length to maxStringSize if (strlen($artistString) > $maxStringSize) $maxStringSize = strlen($artistString); if (strlen($songString) > $maxStringSize) $maxStringSize = strlen($songString); // Build the image length at 10 pixels per character in the longest string $imageWidth = 10 * $maxStringSize; // Create the image $im = imagecreate ($imageWidth, 50); $bgc = imagecolorallocate ($im, 255, 255, 255); $tc = imagecolorallocate ($im, 0, 0, 0); // Place now playing information on image imagestring ($im, 3, 1, 15, $artistString, $tc); imagestring ($im, 3, 1, 30, $songString, $tc); imagestring ($im, 3, 1, 0, $nowplaying, $tc); // Output the image ImagePNG($im); ?> |
Nou wil ik graag dat ik op een of andere manier van dit PNGtje die je dus aanroept als x.php een JPG of wat anders maken zodat ik dus rechtstreeks een JPG of wat anders aanroep.
Ik heb al es zitten stoeien en de verschillende functies op php.net bekeken maar kom er niet echt uit.
Iemand een oplossing voor mij of een voorzetje?
BTW
[ Voor 6% gewijzigd door RammY op 09-07-2005 15:19 ]
Deze advertentieplaats is te huur!