Anybody good at PHP? attn: bitwise
Posted: Mon May 16, 2005 3:43 am
I don't know shit and need some help.
Your world is waiting...
https://quake3world.com/forum/
Uhhh...with a flash editor?andyman wrote:What are you trying to do?
http://andyman82.com/forum/index.php
Edit: while its out there, how in the hell can I cahnge the big "LOGO" on the top left?
Code: Select all
<?php
error_reporting(E_ALL ^ E_NOTICE);
$file = "now_playing.xml";
$xml_parser = xml_parser_create();
if ( is_file( $file ) )
{
$fp = fopen( $file, "r" );
$data = fread( $fp, filesize( $file ) );
fclose( $fp );
xml_parse_into_struct( $xml_parser, $data, $vals, $index );
xml_parser_free( $xml_parser );
if ( isset( $_GET["debug"] ) )
{
echo "<pre>";
echo "Index array\n";
print_r($index);
echo "\nVals array\n";
print_r($vals);
echo "</pre>\n\n";
}
$fHeader = false;
if ( $vals[ $index["NOW_PLAYING"][0] ]["attributes"]["PLAYING"] == 1 )
{
foreach ( $index["TITLE"] as $i => $j )
{
$url = '';
$title = $vals[ $index["TITLE"][$i] ]["value"];
if ( strlen( $title ) > 0 )
{
$artist = $vals[ $index["ARTIST"][$i] ]["value"];
$album = $vals[ $index["ALBUM"][$i] ]["value"];
$genre = $vals[ $index["GENRE"][$i] ]["value"];
$kind = $vals[ $index["KIND"][$i] ]["value"];
$track = $vals[ $index["TRACK"][$i] ]["value"];
$numtracks = $vals[ $index["NUMTRACKS"][$i] ]["value"];
$year = $vals[$index["YEAR"][$i] ]["value"];
$comments = $vals[ $index["COMMENTS"][$i] ]["value"];
$time = $vals[ $index["TIME"][$i] ]["value"];
$bitrate = $vals[ $index["BITRATE"][$i] ]["value"];
$rating = $vals[ $index["RATING"][$i] ]["value"];
$disc = $vals[ $index["DISC"][$i] ]["value"];
$numdiscs = $vals[ $index["NUMDISCS"][$i] ]["value"];
$playcount = $vals[ $index["PLAYCOUNT"][$i] ]["value"];
$compilation = $vals[ $index["COMPILATION"][$i] ]["value"];
$urlamazon = $vals[ $index["URLAMAZON"][$i] ]["value"];
$urlapple = $vals[ $index["URLAPPLE"][$i] ]["value"];
$imageurl = $vals[ $index["IMAGE"][$i] ]["value"];
$composer = $vals[ $index["COMPOSER"][$i] ]["value"];
$urlsource = $vals[ $index["URLSOURCE"][$i] ]["value"];
$grouping = $vals[ $index["GROUPING"][$i] ]["value"];
if ( strlen( $grouping ) > 0 && strcmp( $grouping, "Podcast" ) == 0 )
{
$imageurl = '/images/podcast.gif';
}
else if ( strlen( $imageurl ) == 0 )
{
$imageurl = '/images/music-no-image.gif';
}
else
{
list($width, $height, $type, $attr) = getimagesize( $imageurl );
if ( $width == 1 || $height == 1 )
{
$imageurl = '/images/music-no-image.gif';
}
}
#
# If we couldn't find them at Amazon, let's just do an artist search at B&N
#
if ( strlen( $urlamazon ) > 0 )
{
$url = $urlamazon;
}
else if ( strncmp( $comments, "http://", 7 ) == 0 )
{
$url = $comments;
}
else if ( strlen( $urlsource ) > 0 )
{
$url = $urlsource;
}
else
{
$url = 'http://music.barnesandnoble.com/search/results.asp?NME=' . urlencode( $artist ) . '&SNG=&INS=&LBL=&TYP=P&CAT=&Search=Search';
}
#
# Output
#
if ( isset( $_GET["debug"] ) )
{
echo "<script type=\"text/javascript\">\n";
}
if ( !$fHeader )
{
$fHeader = true;
echo 'document.write("<div class=\"sidetitle\">Now Playing (<a href=\"http://brandon.fuller.name/archives/hacks/nowplaying/\">?</a>)</div>");' . "\n";
}
echo 'document.write("<div class=\"side\" style=\"text-align: center;\"><a href=\"' . $url . '\" target=\"new\"><img src=\"' . $imageurl . '\" alt=\"' . htmlentities( $artist, ENT_QUOTES );
if ( strlen( $album ) > 0 )
{
echo ' - ' . htmlentities( $album, ENT_QUOTES );
}
echo '\" /></a><br /><a href=\"' . $url . '\" target=\"new\">' . htmlentities( $artist, ENT_QUOTES ) . '</a><br><i>' . htmlentities( $title, ENT_QUOTES ) . "</i>\");\n";
if ( strlen( $rating ) > 0 && !isset( $_GET["hide_rating"] ) )
{
echo 'document.write("<br /><br /><img src=\"/images/stars-' . $rating . '.gif\" alt=\"Rating\" />");' . "\n";
}
if ( strlen( $urlapple ) > 0 )
{
echo 'document.write("<br /><br /><a href=\"' . $urlapple . '\"><img src=\"/images/iTunes.gif\" alt=\"View at iTunes Music Store!\" /></a>");' . "\n";
}
echo "document.write(\"</div>\");\n";
if ( isset( $_GET["debug"] ) )
{
echo "</script>\n";
}
}
}
}
}
?>yea i know that but it is embedded in the php code somewhere and i don't know how to make it read a different image. I have found the original flash of LOGO HERE but no programs are able to break it down into editable parts.Canidae wrote:Uhhh...with a flash editor?andyman wrote:What are you trying to do?
http://andyman82.com/forum/index.php
Edit: while its out there, how in the hell can I cahnge the big "LOGO" on the top left?
Code: Select all
<?php
error_reporting(E_ALL ^ E_NOTICE);
$file = "now_playing.xml";
$xml_parser = xml_parser_create();
if ( is_file( $file ) )
{
$fp = fopen( $file, "r" );
$data = fread( $fp, filesize( $file ) );
fclose( $fp );
xml_parse_into_struct( $xml_parser, $data, $vals, $index );
xml_parser_free( $xml_parser );
if ( isset( $_GET["debug"] ) )
{
echo "<pre>";
echo "Index array\n";
print_r($index);
echo "\nVals array\n";
print_r($vals);
echo "</pre>\n\n";
}
$fHeader = false;
if ( $vals[ $index["NOW_PLAYING"][0] ]["attributes"]["PLAYING"] == 1 )
{
foreach ( $index["TITLE"] as $i => $j )
{
$url = '';
$title = $vals[ $index["TITLE"][$i] ]["value"];
if ( strlen( $title ) > 0 )
{
$artist = $vals[ $index["ARTIST"][$i] ]["value"];
$album = $vals[ $index["ALBUM"][$i] ]["value"];
$genre = $vals[ $index["GENRE"][$i] ]["value"];
$kind = $vals[ $index["KIND"][$i] ]["value"];
$track = $vals[ $index["TRACK"][$i] ]["value"];
$numtracks = $vals[ $index["NUMTRACKS"][$i] ]["value"];
$year = $vals[$index["YEAR"][$i] ]["value"];
$comments = $vals[ $index["COMMENTS"][$i] ]["value"];
$time = $vals[ $index["TIME"][$i] ]["value"];
$bitrate = $vals[ $index["BITRATE"][$i] ]["value"];
$rating = $vals[ $index["RATING"][$i] ]["value"];
$disc = $vals[ $index["DISC"][$i] ]["value"];
$numdiscs = $vals[ $index["NUMDISCS"][$i] ]["value"];
$playcount = $vals[ $index["PLAYCOUNT"][$i] ]["value"];
$compilation = $vals[ $index["COMPILATION"][$i] ]["value"];
$urlamazon = $vals[ $index["URLAMAZON"][$i] ]["value"];
$urlapple = $vals[ $index["URLAPPLE"][$i] ]["value"];
$imageurl = $vals[ $index["IMAGE"][$i] ]["value"];
$composer = $vals[ $index["COMPOSER"][$i] ]["value"];
$urlsource = $vals[ $index["URLSOURCE"][$i] ]["value"];
$grouping = $vals[ $index["GROUPING"][$i] ]["value"];
if ( strlen( $grouping ) > 0 && strcmp( $grouping, "Podcast" ) == 0 )
{
$imageurl = '/images/podcast.gif';
}
else if ( strlen( $imageurl ) == 0 )
{
$imageurl = '/images/music-no-image.gif';
}
else
{
list($width, $height, $type, $attr) = getimagesize( $imageurl );
if ( $width == 1 || $height == 1 )
{
$imageurl = '/images/music-no-image.gif';
}
}
#
# If we couldn't find them at Amazon, let's just do an artist search at B&N
#
if ( strlen( $urlamazon ) > 0 )
{
$url = $urlamazon;
}
else if ( strncmp( $comments, "http://", 7 ) == 0 )
{
$url = $comments;
}
else if ( strlen( $urlsource ) > 0 )
{
$url = $urlsource;
}
else
{
$url = 'http://music.barnesandnoble.com/search/results.asp?NME=' . urlencode( $artist ) . '&SNG=&INS=&LBL=&TYP=P&CAT=&Search=Search';
}
#
# Output
#
if ( isset( $_GET["debug"] ) )
{
echo "<script type=\"text/javascript\">\n";
}
if ( $fHeader )
{
$fHeader = true;
echo 'document.write("<div class=\"sidetitle\">Now Playing (<a href=\"http://brandon.fuller.name/archives/hacks/nowplaying/\">?</a>)</div>");' . "\n";
}
echo 'document.write("<div class=\"side\" style=\"text-align: center;\"><a href=\"' . $url . '\" target=\"new\">' . htmlentities( $artist, ENT_QUOTES ) . '</a><br><a href=\"' . $url . '\" target=\"new\"><img src=\"' . $imageurl . '\" alt=\"' . htmlentities( $artist, ENT_QUOTES );
if ( strlen( $album ) > 0 )
{
echo ' - ' . htmlentities( $album, ENT_QUOTES );
}
echo '\" /></a><br /><i>' . htmlentities( $title, ENT_QUOTES ) . "</i>\");\n";
if ( strlen( $rating ) > 0 && !isset( $_GET["hide_rating"] ) )
{
echo 'document.write("<br /><br /><img src=\"/images/stars-' . $rating . '.gif\" alt=\"Rating\" />");' . "\n";
}
if ( strlen( $urlapple ) > 0 )
{
echo 'document.write("<br /><br /><a href=\"' . $urlapple . '\"><img src=\"/images/iTunes.gif\" alt=\"View at iTunes Music Store!\" /></a>");' . "\n";
}
echo "document.write(\"</div>\");\n";
if ( isset( $_GET["debug"] ) )
{
echo "</script>\n";
}
}
}
}
}
?>
Yeah I'm planning on uploading the images.bitWISE wrote:Ok, this should tweak it the way you want. If you want to run images on your machine I could setup a system for you but we would have to agree on what you wanted to do and you would need to manually upload those images in the format. For example do want to have it setup like: 'images/albums/artist-album.gif' ?
Code: Select all
http://music.barnesandnoble.com/search/results.asp?NME=Code: Select all
. urlencode( $artist ) . '&SNG=&INS=&LBL=&TYP=P&CAT=&Search=Search';