ERLEDIGT
NEIN
NEIN
ANTWORTEN
4
4
ZUGRIFFE
407
407
EMPFEHLEN
-
Hellow ppl..
bin mir nicht ganz sicher, an welches Forum ich mich wenden soll.. versuche es hier mal:
habe mir so ein WinAmp-Plugin heruntergeladen, dass es mir ermöglicht den aktuellen Songtitel an die Datei winamp.php zu senden und auszugeben.
Folgend der Code:
Jetzt möchte ich aber, dass wenn der Song zu Ende ist nicht mehr der Songtitel steht, sondern "nichts" z.B.. Entweder muss ich hierfür das WinAmp-Plugin umschreiben (keine Ahnung wie das geht) und das so machen, dass wenn kein Song läuft diese txt-Datei geleert wird, oder aber ich mache das im Script mittels "if" (nehmen wir an, kein Song dauert länger als 5 Minuten) und sage dem Script, dass es mir falls $time > 5 min (wie realisiere ich diesen Vergleich am besten) "nichts" ausgeben soll.PHP-Code:<?php
/* ----------------------------------------------------------------
| Scriptname : Info Sender's PHP Sidekick v3 PNG-Output
| Taken From : appel@nr78.net
| Updated By : Sami Khan - sukhan@ucalgary.ca (v2)
| Updates By : Patrick aka Tutti patrick@pc-mind.de (v3)
| Website : http://www.pc-mind.de
| License : GPL'd (by Sami ;-) )
|
| I find an Image-Output better ;-)
| Make an empty file called winamp.txt,
| put it in the same directory as this php file and then change the
| permission of the file to 777 by doing a "chmod 777" at the console.
| Copy the button.png in the same directory
| Then simply simply point your Info-Sender to:
| http://path_to_your/winamp.php?song=
| Make sure you have all of the last part, ie. ?song=
| Now look the picture with <img src="http://path_to_your/winamp.php">
| Enjoy, any questions feel free to e-mail me.
* ------------------------------------------------------------------ */
$song = $_GET[song];
$filename = 'winamp.txt';
$chars = 50;
// text in Picture
$text = "Ich höre gerade...";
$text2 = "";
// 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 30 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, 255, 255, 255);
ImageString($im,1,315,3,$time,$color);
ImageString($im,1,32,10,$text,$color);
ImageString($im,2,35,18,$songname,$color);
ImageString($im,1,195,30,$text2,$color2);
ImagePng($im);
ImageDestroy($im);
}
//end new Edit PNG-Output
?>
Welche der beiden Lösungsansätze haltet IHR für die bessere?
Danke für euren Rat!
-
20.12.05 20:34 #2
Die Lösung mit den 5Minuten ist sicherlich die Beste. Vielleicht kannst du das PlugIn ja auch so umschreiben, dass er nicht nur Titel&Interpret, sondern auch Länge des Songs mitschickt, dann kannst du die 5Minuten ja durch die Länge des jeweiligen Songs ersetzen.
mAu
P.s.: Wen interessiert eigendlich, was für Musik man gerade hört? *kopfschüttel*Gruß mAu
──────────────────────────
Ich auf flickr
* Unformatierten Quellcode schaue ich mir _nicht_ an!
* Sollte ich euch bei einer Frage weitergeholfen haben, würde ich mich über eine positive Bewertung freuen.
* Bitte die Netiquette beachten.
* Vergesst nicht, beantwortete Fragen als erledigt zu markieren!
-
EigenTlich interessierts einige Leute. So abwegig kann die Idee nicht sein, zumal die Microsoft Etage die gleiche Idee auch für den MSN Messenger hatte. Nicht wahr?
Wer (welches Forum?) könnte mir denn helfen bei einem DLL-Umbau?
-
20.12.05 22:40 #4
- Registriert seit
- Nov 2004
- Beiträge
- 505
Zitat von LN5
²³
wahrscheinlich die entwickler selbst winamp.com => forum
-
Da die Sache in C++ geschrieben ist, wäre das betreffende Forum eine gute Anlaufstelle.
Zitat von LN5
Ähnliche Themen
-
PHP + MP3 + WinAmp
Von MadCrusher im Forum PHPAntworten: 9Letzter Beitrag: 16.10.07, 15:23 -
Winamp und ICQ
Von SoltanDemoriel im Forum Audiotechnik, Recording & Audio-SoftwareAntworten: 0Letzter Beitrag: 17.06.05, 14:44 -
Winamp Pls
Von Harbinator im Forum Visual Basic 6.0Antworten: 2Letzter Beitrag: 07.04.03, 17:11 -
Winamp
Von Sea im Forum Audiotechnik, Recording & Audio-SoftwareAntworten: 2Letzter Beitrag: 24.09.02, 18:51 -
Winamp 3
Von Kaprolactam im Forum Internet, DSL & FlatrateAntworten: 9Letzter Beitrag: 14.08.02, 15:23





Zitieren
Login






[PHP][Snippet] Array zu XML konvertieren