You are not logged in.
Dear visitor, welcome to Aqua Computer Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
![]() |
Source code |
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
<?php $song = $_GET[song]; $filename = 'winamp.txt'; $chars = 300; // text in Picture $text = "Ich höre..."; $text2 = "www.Eihwaz-Horizont.de"; // check if Info Sender is calling the script if(isset($_GET[song])) { // check if text file is writeable if(is_writable($filename)) { // check if we can open the text file if(!$handle = fopen($filename, 'w')) { print "Cannot open file ($filename)"; exit; } // check if we can wite to the text file if(!fwrite($handle, stripslashes($song))) { print "Cannot write to file ($filename)"; exit; } // close the door behind you fclose($handle); } } else { // grab song title from text file $songname = @implode('',@file($filename)); //new Edit PNG-Output // replace german special character $songname = ereg_replace("Ä","Ä",$songname); $songname = ereg_replace("ä","ä",$songname); $songname = ereg_replace("Ö","Ö",$songname); $songname = ereg_replace("ö","ö",$songname); $songname = ereg_replace("Ü","Ü",$songname); $songname = ereg_replace("ü","ü",$songname); $songname = ereg_replace("ß","ß",$songname); // short the Songtext to 300 Characters if(strlen($songname) > $chars) { $songname = substr($songname,0,$chars); $songname .= "..."; } //read Create-date of winamp.txt if (file_exists($filename)) { $time = date("j.m.Y H:i", filectime($filename)); } //now we build the png with the Songtext Header("Content-type: image/png"); $im = ImageCreateFromPng("button.png"); $color = ImageColorAllocate($im, 0, 0, 0); $color2 = ImageColorAllocate($im, 0, 0, 0); ImageString($im,1,5,31,$time,$color); ImageString($im,2,5,3,$text,$color); ImageString($im,2,10,17,$songname,$color); ImageString($im,1,350,31,$text2,$color2); ImagePng($im); ImageDestroy($im); } //end new Edit PNG-Output ?> |
crushcoder
God
Gott hat die Welt ja nur in sieben Tagen erschaffen können, weil es keine installierte Basis gab.
crushcoder
God
Gott hat die Welt ja nur in sieben Tagen erschaffen können, weil es keine installierte Basis gab.
Quoted from "Manwe"
ne... die php-seite hat mir nich wirklich geholfen...
das script klappt ja ohne probleme, wenn es mit einem (hier babyblauen) bild arbeitet... nur bei einem transparenten klappt es nicht.
und das komisch ist ja eben, dass es von einem tag auf den anderen nicht mehr geht... obwohl nichts geändert wurde. weder das script an sich, noch das bild...
ps: was mir noch auffält... der IE ist scheinbar zu blöd, um transparente png-bilder richtig anzuzeigen... doofes teil
Quoted
If you're trying to load a translucent png-24 image but are finding an absence of transparency (like it's black), you need to enable alpha channel AND save the setting. I'm new to GD and it took me almost two hours to figure this out.
<?php
$imgPng = imageCreateFromPng($strImagePath);
imageAlphaBlending($imgPng, true);
imageSaveAlpha($imgPng, true);
/* Output image to browser */
header("Content-type: image/png");
imagePng($imgPng);
?>
![]() |
Source code |
1 |
imageAlphaBlending($im, false); |
![]() |
Source code |
1 |
imageAlphaBlending($im, true); |
![]() |
Source code |
1 2 3 4 5 6 7 8 |
// replace german special character $songname = ereg_replace("Ä","Ä",$songname); $songname = ereg_replace("ä","ä",$songname); $songname = ereg_replace("Ö","Ö",$songname); $songname = ereg_replace("ö","ö",$songname); $songname = ereg_replace("Ü","Ü",$songname); $songname = ereg_replace("ü","ü",$songname); $songname = ereg_replace("ß","ß",$songname); |
![]() |
Source code |
1 2 3 4 5 6 7 8 |
// replace german special character $songname = ereg_replace("Ä","Ae",$songname); $songname = ereg_replace("ä","ae",$songname); $songname = ereg_replace("Ö","Oe",$songname); $songname = ereg_replace("ö","oe",$songname); $songname = ereg_replace("Ü","Ue",$songname); $songname = ereg_replace("ü","ue",$songname); $songname = ereg_replace("ß","ss",$songname); |
![]() |
Source code |
1 2 3 4 5 6 7 8 |
// replace german special character $songname = ereg_replace("& Auml;","Ä",$songname); $songname = ereg_replace("& auml;","ä",$songname); $songname = ereg_replace("& Ouml;","Ö",$songname); $songname = ereg_replace("& ouml;","ö",$songname); $songname = ereg_replace("& Uuml;","Ü",$songname); $songname = ereg_replace("& uuml;","ü",$songname); $songname = ereg_replace("& szlig;","ß",$songname); |
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
// check if Info Sender is calling the script if(isset($_GET[song])) { // check if text file is writeable if(is_writable($filename)) { // check if we can open the text file if(!$handle = fopen($filename, 'w')) { print "Cannot open file ($filename)"; exit; } // check if we can wite to the text file if(!fwrite($handle, stripslashes($song))) { print "Cannot write to file ($filename)"; exit; } // close the door behind you fclose($handle); } } else { |
Quoted from "biddschedabber"
Sag mal, könntest Du mir noch erklären, für was der Teil check if Info Sender is calling the script und die dazugehörige if-Schleife sein soll? Ich verstehe, dass da das Lese- und Schreibrecht einer Datei geprüft wird, aber wofür das ganze?
-