AMIP Dynamic Signature (AMIPDS) v0.4c
by Serge A. Baranov (coder at tools-for dot net)
http://amip.tools-for.net

What's this?
==========================
It is a set of scripts and tools to make dynamic image signatures
to be used in forums, web pages, etc.

Requirements:
==========================
1. Web server
2. PHP 4.2+ running on the web server
3. PHP GD enabled with PNG/JPG and TTF support
   (GD is a library for manipulating images)
4. AMIP 2.35 and later or other plug-in which can provide a lot
   of song information and can pass it to the script
   using HTTP POST or GET methods
5. Some brains =)

Remote configuration
==========================
Upload the entire 'np' directory from this distribution to the Web
server. Now the script should be accessible with the

http://URL/np/signature.php URL.

Before uploading the script to the web you may open it in your favourite
text editor and modify the configuration parameters. By default the script
should work without any modification, so if you are not familiar with PHP
leave it as is.

Your 'np' directory on the server must contain the following files:

signature.php  - the main script
base_image.png - background PNG image
base_image.jpg - background JPG image
impact.ttf     - font for the song title
lucon.ttf      - font for the additional song info
npvars.txt     - stub for the real file keeping signature information

Finally make sure that this directory is writable, the script will create
a file with song parameters in it.

IMPORTANT: You may need to adjust file permissions:
% chmod 777 signature.php
% chmod 666 npvars.txt

Local configuration
==========================
Copy 'amipweb' directory to some drive, for example to C:\.
Make sure that C:\amipweb\ directory contains the following files:

curl.exe     - a tool used by AMIP to pass parameters to the script
               using HTTP GET or POST (see http://curl.haxx.se/).
amipweb.conf - a config template to be used with curl.exe

Open amipweb.conf in the text editor, modify the 'url' parameter.
It must point to the signature.php script on your server.

For the security reasons change the 'action' value to something else. But
make sure that in the signature.php $config['action'] is set to the same word.

You can leave the other settings as is for now.

AMIP configuration
==========================
If you don't have AMIP, download it from http://amip.tools-for.net,
it is a Winamp 2 / Winamp 3 / Apollo / QCD now playing plug-in.

Go to the AMIP options. Make sure that IRC integration is enabled,
actually we are not going to post anything to mIRC, but we need to
use a preset. Choose any of the presets, make it active, put the
following code in it (just copy & paste):

/template:(c:\amipweb\amipweb.conf) c:\amipweb\amipweb.out
/exec:(c:\amipweb\curl.exe) -K amipweb.out

If you are using AMIP Configuratior, then the better place for this
code is Callbacks/Web | Change tab.

Code description:
The /template command parses amipweb.conf, replaces song variables and
saves the result in amipweb.out.
cURL is executed with -K parameter which tells it to use amipweb.out
configuration file.

That's all! Now every time when song changes in your player, the image
will be automatically updated to the server.

Accessing the generated signature image
==========================
The image can be linked in the following way:

http://URL/np/signature.php/sig.png

Some servers do not understand such syntax, in this case use the following:

http://URL/np/signature.php

or you can enable static image generation in signature.php and link directly
to the static image like:

http://URL/np/sig.png

Customization:
==========================
You can edit signature.php and change the configuration options to setup
your own fonts, base image, fonts color, and fonts sizes.

You can also change amipweb.conf and signature.php in order to provide
different song information or format it in another way.
