root/original/common/portrait_grab.php

Revision 1, 1.5 KB (checked in by andrewgunn, 14 years ago)

Added original EVE-Killboard.net source code.

Line 
1<?
2  require_once( "class.page.php" );
3  require_once( "class.pilot.php" );
4  require_once( "class.corp.php" );
5  require_once( "class.alliance.php" );
6
7  $page = new Page( "Capture portrait" );
8
9  $html .= "<html><head><title>Update portrait</title></head><body>";
10
11  if ( !$page->igb() ) {
12    $html .= "You need to access this page from the EVE ingame browser.";
13  }
14  else {
15    if ( ( $_SERVER['HTTP_EVE_TRUSTED'] == 'no' ) ) {
16      Header( 'eve.trustme:http://' . $_SERVER['HTTP_HOST'] . '/::Need trust to grab character portrait.' );
17      $html .= '<h1>Trust Required</h1>';
18      $html .= 'This site needs to be trusted in order to grab your character portrait.';
19    }
20    else {
21      $now = date( "Y-m-d H:m:s" );
22
23      $alliance = new Alliance();
24      $all_id = $alliance->add( $_SERVER['HTTP_EVE_ALLIANCENAME'] );
25      $corp = new Corporation();
26      $crp_id = $corp->add( $_SERVER['HTTP_EVE_CORPNAME'], $alliance, $now );
27      $pilot = new Pilot();
28      $plt_id = $pilot->add( $_SERVER['HTTP_EVE_CHARNAME'], $corp, $now );
29      $pilot->setCharacterID( $_SERVER['HTTP_EVE_CHARID'] );
30      @unlink( "cache/portraits/".$_SERVER['HTTP_EVE_CHARID']."_32.jpg" );
31      @unlink( "cache/portraits/".$_SERVER['HTTP_EVE_CHARID']."_64.jpg" );
32      @unlink( "cache/portraits/".$_SERVER['HTTP_EVE_CHARID']."_128.jpg" );
33
34//      $html .= "<img src=\"".$pilot->getPortraitURL( 64 ).".jpg\" border=\"0\">";
35      $html .= "Character portrait updated !<br>";
36      $html .= "<a href=\"?a=igb\">Return</a><br>";
37    }
38  }
39
40  $html .= "</body></html>";
41
42  echo $html;
43?>
Note: See TracBrowser for help on using the browser.