All pastes #737273 Raw Edit

Someone

public text v1 · immutable
·published 2007-10-15 09:13 UTC
rendered paste body
<?php
$version = '4.0';
$config['PATH'] = '.';
$config['BACKGROUND'] = 'background.gif';
$config['ALBUMARTBG'] = 'albumart.gif';
$config['ALBUMARTPATH'] = '../albumart';
$config['FONT'] = '../arialbold.ttf';
$config['FONTDARKFG'] =  array(35,  35,  35);
$config['FONTDARKBG'] =  array(203, 203, 203);
$config['FONTLIGHTFG'] = array(255, 255, 255);
$config['FONTLIGHTBG'] = array(66,  66,  66);
$config['OFFLINETEXT'] = "Winamp\nOffline";

$online = false;

$offset_vertical = 9;
$offset_horizontal = 9;

// Get the background image
$img_background = imagecreatefromgif($config['PATH'].'/'.$config['BACKGROUND']);

// Create the album art image (if it exists)
$albumart = albumart($_REQUEST['album'], $online);
$albumartdrawn = false;
if ($albumart) {
  if ($img_albumartbg = @imagecreatefromgif($config['PATH'].'/'.$config['ALBUMARTBG'])) {
    if ($img_albumart = @imagecreatefromjpeg($config['ALBUMARTPATH'].'/'.$albumart)) {
      imagecopy($img_background, $img_albumartbg, 9, 9, 0, 0, imagesx($img_albumartbg), imagesy($img_albumartbg));
      imagecopyresized($img_background, $img_albumart, 11, 11, 0, 0, 48, 48, imagesx($img_albumart), imagesy($img_albumart));
      imagedestroy($img_albumart);
      $albumartdrawn = true;
    }
    imagedestroy($img_albumartbg);
  }
}

// Update the offset if we have successfully drawn album art
if ($albumartdrawn) {
  $offset_horizontal += 56;
}

// Draw offline image and exit here if not online
if (!$online) {
  $clr_darkfg = imagecolorallocate($img_background, $config['FONTDARKFG'][0], $config['FONTDARKFG'][1], $config['FONTDARKFG'][2]);
//  $clr_darkbg = imagecolorallocate($img_background, $config['FONTDARKBG'][0], $config['FONTDARKBG'][1], $config['FONTDARKBG'][2]);
$color_darkbg = imagecolorallocate($img_background, 255, 0, 0);
  imagettftext($img_background, 8, 0, 65, 18, $color_darkbg, $config['PATH'].'/'.$config['FONT'], $config['OFFLINETEXT']);
//  imagettftext($img_background, 8, 0, 65, 17, $clr_darkfg, $config['PATH'].'/'.$config['FONT'], $config['OFFLINETEXT']);
  headers();
  imagegif($img_background);
  imagedestroy($img_background);
  exit;
}
?>