Changeset 134

Show
Ignore:
Timestamp:
12/06/06 03:11:17 (14 years ago)
Author:
exi
Message:

Added standings-management.
Changed installer step 3 to only use POST data now.
Character portraits should now look a bit better.
Changed all smarty template requests to use a wrapper function.
Modified standard page for IGB.
Added php compat file to reduce minimal needed version to 4.0.9.

Location:
dev
Files:
19 added
1 removed
22 modified

Legend:

Unmodified
Added
Removed
  • dev/cache

    • Property svn:ignore set to
      *
  • dev/common/admin.php

    r116 r134  
    3232    $config->checkCheckbox('least_active'); 
    3333    $config->checkCheckbox('adapt_items'); 
     34    $config->checkCheckbox('show_standing'); 
    3435 
    3536    if ($config->checkCheckbox('comments')) 
     
    141142} 
    142143$html .= "></td></tr>"; 
     144$html .= "<tr><td width=120><b>Display Standings:</b></td><td><input type=checkbox name=show_standing id=show_standing"; 
     145if ($config->getConfig('show_standing')) 
     146{ 
     147    $html .= " checked=\"checked\""; 
     148} 
     149$html .= "></td></tr>"; 
    143150 
    144151$html .= "<tr><td width=120><b>Enable Lost Item Values</b></td><td><input type=checkbox name=item_values id=item_values"; 
  • dev/common/admin_mapoptions.php

    r123 r134  
    9292$smarty->assign_by_ref('config', $config); 
    9393$smarty->assign_by_ref('options', $options); 
    94 $html = $smarty->fetch('admin_mapoptions.tpl'); 
     94$html = $smarty->fetch(get_tpl('admin_mapoptions')); 
    9595 
    9696$page->addContext($menubox->generate()); 
  • dev/common/admin_menu.php

    r104 r134  
    77$menubox->addOption("link","Contracts", "?a=admin_cc&op=view&type=contract"); 
    88$menubox->addOption("link","Campaigns", "?a=admin_cc&op=view&type=campaign"); 
     9$menubox->addOption("link","Standings", "?a=admin_standings"); 
    910$menubox->addOption("link","Ship Values", "?a=admin_shp_val"); 
    1011$menubox->addOption("link","Synchronization", "?a=admin_sync"); 
  • dev/common/admin_postperm.php

    r91 r134  
    175175    $smarty->assign_by_ref('permissions', $perm); 
    176176} 
    177 $html = $smarty->fetch('admin_postperm.tpl'); 
     177$html = $smarty->fetch(get_tpl('admin_postperm')); 
    178178 
    179179$page->addContext($menubox->generate()); 
  • dev/common/class.box.php

    r110 r134  
    1 <?php  
     1<?php 
    22require_once("class.graph.php"); 
    33require_once("globals.php"); 
     
    1010                $this->box_array = array(); 
    1111    } 
    12          
     12 
    1313    function setIcon($icon)                                     //its called setIcon... and it sets the Icon. 
    1414    { 
    1515        $this->icon_ = $icon; 
    1616    } 
    17          
    18         function addOption($type,$name,$url="") //add something to the array that we send to smarty later... types can be caption, img, link, points. Only link needs all 3 attribues  
     17 
     18        function addOption($type,$name,$url="") //add something to the array that we send to smarty later... types can be caption, img, link, points. Only link needs all 3 attribues 
    1919        { 
    2020        $this->box_array[]=array('type' => $type, 'name' => $name, 'url' => $url); 
     
    2929        $smarty->assign('title',$this->title_ ); 
    3030        $smarty->assign('items',$this->box_array); 
    31         return $smarty->fetch('box.tpl'); 
     31        return $smarty->fetch(get_tpl('box')); 
    3232    } 
    3333} 
     
    7272        { 
    7373            if (!$rows[$i - 1]['plt_id']) break; 
    74             $pilot = new Pilot($rows[$i - 1]['plt_id']);  
     74            $pilot = new Pilot($rows[$i - 1]['plt_id']); 
    7575                        $bar = new BarGraph($rows[$i - 1]['cnt'], $max, 60); 
    7676                        $top[$i] = array('url'=> "?a=pilot_detail&plt_id=" . $rows[$i - 1]['plt_id'], 'name'=>$pilot->getName(),'bar'=>$bar->generate(),'cnt'=>$rows[$i - 1]['cnt']); 
     
    7878                $smarty->assign('top',$top); 
    7979                $smarty->assign('comment',$this->comment_); 
    80                 return $smarty->fetch('award_box.tpl'); 
     80                return $smarty->fetch(get_tpl('award_box')); 
    8181    } 
    82          
     82 
    8383} 
    8484?> 
  • dev/common/class.comments.php

    r130 r134  
    2222 
    2323        $smarty->assign_by_ref('comments', $this->comments_); 
    24         return $smarty->fetch('block_comments.tpl'); 
     24        return $smarty->fetch(get_tpl('block_comments')); 
    2525    } 
    2626 
  • dev/common/class.item.php

    r133 r134  
    1818    { 
    1919        $this->execQuery(); 
    20 //        if (!$this->row_['itm_name']) 
    21 //        { 
    22 //            return $this->id_; 
    23 //        } 
    2420        return $this->row_['itm_name']; 
    2521    } 
    26  
    27  
    2822 
    2923    function getIcon($size = 32) 
     
    4741        } 
    4842 
    49         if (substr($this->getName(), strlen($this->getName()) - 2, 2) == "II" || $this->row_['techlevel']) 
     43        if (substr($this->getName(), strlen($this->getName()) - 2, 2) == "II" || $this->row_['techlevel'] == 2) 
    5044        { 
    5145            $icon .= IMG_URL.'/items/32_32/t2.gif'; 
     
    5852        $smarty->assign('img', $img); 
    5953        $smarty->assign('icon', $icon); 
    60         return $smarty->fetch('icon.tpl'); 
     54        return $smarty->fetch(get_tpl('icon')); 
    6155    } 
    6256 
     
    7165        if (!$this->qry_->executed_) 
    7266        { 
     67            if (!$this->id_) 
     68            { 
     69                return false; 
     70            } 
    7371            $this->sql_ = "select * 
    7472                           from kb3_items, kb3_item_types 
  • dev/common/class.killlisttable.php

    r123 r134  
    9090 
    9191        $smarty->assign_by_ref('killlist', $kl); 
    92         return $smarty->fetch('killlisttable.tpl'); 
     92        return $smarty->fetch(get_tpl('killlisttable')); 
    9393    } 
    9494} 
  • dev/common/class.page.php

    r86 r134  
    8181            { 
    8282                $menu->add('campaigns', 'Campaigns'); 
     83            } 
     84            $w = 10; 
     85            if ($campaigns) 
     86            { 
     87                $w--; 
     88            } 
     89            if ($contracts) 
     90            { 
     91                $w--; 
     92            } 
     93            if ($config->getConfig('show_standing')) 
     94            { 
     95                $w--; 
     96                $menu->add('standings', 'Standings'); 
    8397            } 
    8498            $menu->add('kills', 'Kills'); 
     
    100114            $menu->add('about', 'About'); 
    101115 
    102             $w = '10%'; 
    103             if ($contracts || $campaigns) 
    104             { 
    105                 $w = '9%'; 
    106             } 
    107             if ($contracts && $campaigns) 
    108             { 
    109                 $w = '8%'; 
    110             } 
    111  
    112             $smarty->assign('menu_w', $w); 
     116            $smarty->assign('menu_w', $w.'%'); 
    113117            $smarty->assign('menu', $menu->get()); 
    114118        } 
     
    122126        $smarty->assign('content_html', $this->contenthtml_); 
    123127        $smarty->assign('context_html', $this->contexthtml_); 
    124         if ($this->igb_) 
    125         { 
    126             $smarty->display('igb_index.tpl'); 
    127         } 
    128         else 
    129         { 
    130             $smarty->display('index.tpl'); 
    131         } 
     128        $smarty->display(get_tpl('index')); 
    132129    } 
    133130 
  • dev/common/corpportrait.php

    r10 r134  
    2525        $oldy = imagesy($img); 
    2626        imagecopyresampled($newimg, $img, 0, 0, 0, 0, $size, $size, $oldx, $oldy); 
    27         imagejpeg($newimg, $portrait); 
     27        imagejpeg($newimg, $portrait, 95); 
    2828        header("Content-Type: image/jpeg"); 
    2929        readfile($portrait); 
  • dev/common/db.php

    r133 r134  
    22require_once('config.php'); 
    33require_once('globals.php'); 
     4require_once('php_compat.php'); 
    45 
    56class DBConnection 
  • dev/common/globals.php

    r99 r134  
    3939    return number_format(round($s, 1), 1); 
    4040} 
     41 
     42function get_tpl($name) 
     43{ 
     44    if (IS_IGB) 
     45    { 
     46        if (file_exists('./templates/igb_'.$name.'.tpl')) 
     47        { 
     48            return 'igb_'.$name.'.tpl'; 
     49        } 
     50    } 
     51    return $name.'.tpl'; 
     52} 
    4153?> 
  • dev/common/igb.php

    r2 r134  
    1 <? 
    2   require_once( "class.page.php" ); 
     1<?php 
     2require_once("class.page.php"); 
    33 
    4   $kb = new Killboard( KB_SITE ); 
     4$page = new Page("Killboard IGB Menu"); 
     5$html = "<a href=\"?a=post_igb\">Post killmail</a> | <a href=\"?a=portrait_grab\">Update portrait</a>"; 
    56 
    6   $html = "<html><head><title>".KB_TITLE." Killboard"."</title></head></html><body>"; 
    7  
    8   $html .= "<a href=\"?a=post_igb\">Post killmail</a> | <a href=\"?a=portrait_grab\">Update portrait</a>"; 
    9  
    10   $html .= "</body></html>"; 
    11  
    12   echo $html; 
     7$page->setContent($html); 
     8$page->generate(); 
    139?> 
  • dev/common/index.php

    r86 r134  
    1111    $page = 'home'; 
    1212} 
    13 if (substr($_SERVER['HTTP_USER_AGENT'], 0, 15) == 'EVE-minibrowser' && $page != 'igb' && $page != 'post_igb' && $page != 'portrait_grab' && $page != 'bills') 
     13if (substr($_SERVER['HTTP_USER_AGENT'], 0, 15) == 'EVE-minibrowser') 
    1414{ 
    15     $page = 'igb'; 
     15    define('IS_IGB', true); 
     16    if (!isset($_GET['a'])) 
     17    { 
     18        $page = 'igb'; 
     19    } 
     20} 
     21else 
     22{ 
     23    define('IS_IGB', false); 
    1624} 
    1725 
  • dev/common/kill_detail.php

    r132 r134  
    226226$page->addContext($mapbox->generate()); 
    227227 
    228 $html = $smarty->fetch('kill_detail.tpl'); 
     228$html = $smarty->fetch(get_tpl('kill_detail')); 
    229229$page->setContent($html); 
    230230$page->generate(); 
  • dev/common/kill_export.php

    r103 r134  
    254254 
    255255    $smarty->assign_by_ref('permissions', $perm); 
    256     $html = $smarty->fetch('admin_export.tpl'); 
     256    $html = $smarty->fetch(get_tpl('admin_export')); 
    257257} 
    258258 
  • dev/common/portrait.php

    r72 r134  
    6363    $newimg = imagecreatetruecolor($size, $size); 
    6464    imagecopyresampled($newimg, $img, 0, 0, 0, 0, $size, $size, 128, 128); 
    65     imagejpeg($newimg, $portrait); 
     65    imagejpeg($newimg, $portrait, 95); 
    6666    header("Content-Type: image/jpeg"); 
    6767    readfile($portrait); 
  • dev/install/export/export_GRIEFWATCH.php

    r88 r134  
    55exit('please edit file before running'); 
    66 
    7 for ($i = 0; $i>=$num_kills; $i--) 
     7for ($i = 0; $i<=$num_kills; $i++) 
    88{ 
    99    $kill = $i; 
  • dev/install/install_step3.php

    r88 r134  
    44{ 
    55    $_SESSION['sql'] = array(); 
    6     $_SESSION['sql']['host'] = $_REQUEST['host']; 
    7     $_SESSION['sql']['user'] = $_REQUEST['user']; 
    8     $_SESSION['sql']['pass'] = $_REQUEST['dbpass']; 
    9     $_SESSION['sql']['db'] = $_REQUEST['db']; 
     6    $_SESSION['sql']['host'] = $_POST['host']; 
     7    $_SESSION['sql']['user'] = $_POST['user']; 
     8    $_SESSION['sql']['pass'] = $_POST['dbpass']; 
     9    $_SESSION['sql']['db'] = $_POST['db']; 
    1010} 
    1111 
  • dev/templates/admin_postperm.tpl

    r91 r134  
    33<form id="search" action="?a=admin_postperm" method="post"> 
    44<table class="kb-subtable"> 
    5 <tr><td>Type:</td><td>Text: (3 letters minimum)</td></tr> 
    6 <tr><td><select id="searchtype" name="searchtype"><option value="pilot">Pilot</option> 
    7 <option value="corp">Corporation</option> 
    8 <option value="alliance">Alliance</option> 
    9 </select></td><td><input id="searchphrase" name="searchphrase" type="text" size="30"/></td> 
    10 <td><input type="submit" name="submit" value="Search"/></td></tr></table></form> 
     5  <tr><td>Type:</td><td>Text: (3 letters minimum)</td></tr> 
     6  <tr><td><select id="searchtype" name="searchtype"><option value="pilot">Pilot</option> 
     7    <option value="corp">Corporation</option> 
     8    <option value="alliance">Alliance</option> 
     9    </select></td><td><input id="searchphrase" name="searchphrase" type="text" size="30"/></td> 
     10    <td><input type="submit" name="submit" value="Search"/></td> 
     11  </tr> 
     12</table> 
     13</form> 
    1114{if $search} 
    1215<table class="kb-table" width="450" cellspacing="1"> 
    13 <tr class="kb-table-header"><td>Search results</td></tr> 
     16  <tr class="kb-table-header"><td>Search results</td></tr> 
    1417{section name=res loop=$results} 
    15 <tr class="kb-table-row-even"><td><a href="{$results[res].link}">{$results[res].descr}</a></td></tr> 
     18  <tr class="kb-table-row-even"><td><a href="{$results[res].link}">{$results[res].descr}</a></td></tr> 
    1619{sectionelse} 
    17 <tr class="kb-table-row-even"><td>No results.</td></tr> 
     20  <tr class="kb-table-row-even"><td>No results.</td></tr> 
    1821{/section} 
    1922</table> 
     
    2730<table class="kb-table"> 
    2831{section name=opt loop=$permissions} 
    29     <tr class="kb-table-header"><td colspan="2">{$permissions[opt].name}</td></tr> 
     32  <tr class="kb-table-header"><td colspan="2">{$permissions[opt].name}</td></tr> 
    3033{section name=idx loop=$permissions[opt].list} 
    31     <tr><td width="200"><b>{$permissions[opt].list[idx].text}</b></td><td><a href="{$permissions[opt].list[idx].link}">Delete</a></td></tr> 
     34  <tr><td width="200"><b>{$permissions[opt].list[idx].text}</b></td><td><a href="{$permissions[opt].list[idx].link}">Delete</a></td></tr> 
    3235{/section} 
    3336{sectionelse} 
    34 <tr><td>None.</td></tr> 
     37  <tr><td>None.</td></tr> 
    3538{/section} 
    3639</table> 
  • dev/templates/igb_index.tpl

    r86 r134  
    11<html> 
    22<head> 
    3 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> 
    43<title>{$kb_title}</title> 
    5 <link rel="stylesheet" type="text/css" href="{$style_url}/common.css"> 
    6 <link rel="stylesheet" type="text/css" href="{$style_url}/{$style}/style.css"> 
    74</head> 
    8 <body bgcolor="#222222" {$on_load} style="height: 100%"> 
    9 <table class="main-table" height="100%" align="center" bgcolor="#111111" border="0" cellspacing="1" style="height: 100%"> 
    10 <tr style="height: 100%"> 
    11 <td valign="top" height="100%" style="height: 100%"> 
    12 <div id="page-title">{$page_title}</div> 
    13 <table cellpadding=0 cellspacing=0 width="100%" border="0"> 
    14 <tr><td valign="top"><div id="content"> 
     5<body bgcolor="#222222"> 
     6<table heigth="100%" width="100%" bgcolor="#111111" border="0" cellspacing="1"> 
     7<tr> 
     8<td valign="top"> 
     9<div>{$page_title}</div> 
     10<hr> 
    1511{$content_html} 
    16 </div></td> 
    1712{if $context_html} 
    1813<td valign="top" align="right"> 
     
    2015</td> 
    2116{/if} 
    22 </tr></table> 
    23 {if $profile} 
    24 <table class="kb-subtable" width="99%" border="0"> 
    25 <tr><td height="100%" align="right" valign="bottom">{$profile_time}s</td></tr> 
    26 </table> 
    27 {else} 
    28 <!-- {$profile_time}s --> 
    29 {/if} 
    30 <div class="counter"></div> 
     17<hr> 
    3118</td></tr></table> 
    3219</body>