<?php

/**
 *
 * INDEXU
 * Copyright(C), Nicecoder, 2000-2006, All Rights Reserved.
 *
 * INDEXU(tm) is protected by Indonesia and International copyright laws.
 * Unauthorized use or distribution of INDEXU(tm) is strictly prohibited,
 * violators will be prosecuted. To obtain a license for using INDEXU(tm),
 * please register at Nicecoder home page at http://www.nicecoder.com
 *
 * Author:
 *    Dody Rachmat Wicaksono (dody@nicecoder.com)
 *    M. Zuber (zubby@nicecoder.com)
 *
 */

  /*===================================================
    main
  ===================================================*/

  include "application.php";

  RemoveFilter("gzip_compression");
  RemoveFilter("runtime");
  RemoveFilter("start_session");
  RunPreFilter(__FILE__);

  if ($lid) {
    $email = $dbConn->Lookup('email', 'idx_link', "link_id = '$lid'");
  }
  elseif ($u) {
    $email = $dbConn->Lookup('username', 'idx_users', "username = '$u'");
  }
  elseif ($adm) {
    $email = $email_address;
  }
  
  $font = 3;
  $width = 2 + strlen($email) * imagefontwidth($font);
  $height = 2 + imagefontheight($font);
  $image = imagecreate ($width, $height);
  $bg = imagecolorallocate($image, 255, 255, 255);
  $fg = imagecolorallocate($image, 0, 0, 0);
  imagestring ($image, $font, 1, 1, $email, $fg);

  print header ("Content-type: image/png");
  imagepng($image);
  imagedestroy($image);

  RunPostFilter(__FILE__);

?>