Changeset 72 for dev/mods

Show
Ignore:
Timestamp:
11/11/06 00:51:53 (14 years ago)
Author:
exi
Message:

Changed portrait to only store 128x128.
class.http.php now returns false on no connect.
Changed siggen, added errorpicture, changed output to jpg, enabled possibility to use several signatures, added 2 signatures as more examples

Location:
dev/mods/signature_generator
Files:
12 added
2 removed
1 modified

Legend:

Unmodified
Added
Removed
  • dev/mods/signature_generator/sig.php

    r39 r72  
    66$sig_name = str_replace('.', '', $sig_name); 
    77$sig_name = str_replace('/', '', $sig_name); 
     8$sig_name = str_replace('/', '', $sig_name); 
    89 
    910if (!$plt_id = $_GET['i']) 
    1011{ 
     12    header('location: error.jpg'); 
    1113    exit; 
    1214} 
     
    1921if (!$pilot->exists()) 
    2022{ 
     23    header('Location: error.jpg'); 
    2124    exit; 
    2225} 
     
    2730if (ALLIANCE_ID && $alliance->getID() != ALLIANCE_ID) 
    2831{ 
     32    header('Location: error.jpg'); 
    2933    exit; 
    3034} 
    3135elseif (CORP_ID && $corp->getID() != CORP_ID) 
    3236{ 
     37    header('Location: error.jpg'); 
    3338    exit; 
    3439} 
    3540 
     41$id = abs(crc32($sig_name)); 
    3642// check for cached version 
    37 if (file_exists('cache/data/sig_'.$plt_id)) 
     43if (file_exists('cache/data/sig_'.$id.'_'.$plt_id)) 
    3844{ 
    39     $age = filemtime('cache/data/sig_'.$plt_id); 
     45    $age = filemtime('cache/data/sig_'.$id.'_'.$plt_id); 
    4046 
    4147    // cache files for 30 minutes 
    4248    if (time() - $age < 30*60) 
    4349    { 
    44         header('Content-Type: image/png'); 
    45         readfile('cache/data/sig_'.$plt_id); 
     50        header('Content-Type: image/jpg'); 
     51        readfile('cache/data/sig_'.$id.'_'.$plt_id); 
    4652        return; 
    4753    } 
     
    4955 
    5056// check template 
    51 if (!file_exists('mods/signature_generator/signatures/'.$sig_name.'.png')) 
     57if (!is_dir('mods/signature_generator/signatures/'.$sig_name)) 
    5258{ 
     59    header('Location: error.jpg'); 
    5360    exit; 
    5461} 
    55 $im = imagecreatefrompng('mods/signature_generator/signatures/'.$sig_name.'.png'); 
    5662 
    57 $red = imagecolorallocate($im, 255, 10, 10); 
    58 $orange = imagecolorallocate($im, 150, 120, 20); 
    59 $blue = imagecolorallocate($im, 0, 0, 200); 
    60 $white = imagecolorallocate($im, 255, 255, 255); 
    61 $black = imagecolorallocate($im, 0, 0, 0); 
     63require('mods/signature_generator/signatures/'.$sig_name.'/'.$sig_name.'.php'); 
    6264 
    63 $grey_trans = imagecolorallocatealpha($im, 50, 50, 50, 50); 
    64 $greyred_trans = imagecolorallocatealpha($im, 50, 10, 10, 50); 
    65  
    66 $name = $pilot->getName(); 
    67  
    68 $list = new KillList(); 
    69 $list->setOrdered(true); 
    70 $list->setLimit(1); 
    71 $list->setPodsNoobships(false); 
    72 $list->addInvolvedPilot($pilot); 
    73 $kill = $list->getKill(); 
    74  
    75 require('mods/signature_generator/settings/'.$sig_name.'.php'); 
    76  
    77 header('Content-Type: image/png'); 
    78 //imagepng($im); 
    79 imagepng($im, 'cache/data/sig_'.$plt_id); 
    80 readfile('cache/data/sig_'.$plt_id); 
     65header('Content-Type: image/jpg'); 
     66imagejpeg($im, 'cache/data/sig_'.$id.'_'.$plt_id, 95); 
     67readfile('cache/data/sig_'.$id.'_'.$plt_id); 
    8168?>