Changeset 89 for dev/common/admin.php

Show
Ignore:
Timestamp:
11/25/06 16:25:57 (14 years ago)
Author:
exi
Message:

Moved img/banners to img/logo.
Added auto-addition for items as option.
Autoupgrade:
Changed comments to work on mysql < 4.1.
Changed pilot_name to be 64 chars long.
Added system-field for contract targets.
Added index on kb3_item_types.itt_id.
Dropped kb3_ships.shp_description.
Dropped kb3_items.itm_description.
Changed Value to itm_value on kb3_items in case you got that.
Added kb3_items.itm_value to store the market value of items.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/admin.php

    r71 r89  
    11<?php 
    2 require_once("db.php"); 
    3 require_once("class.killboard.php"); 
    4 require_once("class.page.php"); 
    5 require_once("class.tabbedform.php"); 
    6 require_once("admin_menu.php"); 
     2require_once('db.php'); 
     3require_once('class.killboard.php'); 
     4require_once('class.page.php'); 
     5require_once('class.tabbedform.php'); 
     6require_once('admin_menu.php'); 
     7require_once('autoupgrade.php'); 
    78 
    89$killboard = new Killboard(KB_SITE); 
    9 $page = new Page("Administration - Generic"); 
     10$page = new Page('Administration - Generic (Current version: '.KB_VERSION.' Build '.SVN_REV.')'); 
    1011$page->setAdmin(); 
    11 require_once('autoupgrade.php'); 
     12 
     13// check tables for validity and fields 
     14// todo: tidy this mess up!!!!! 
     15check_pilots(); 
    1216check_invdetail(); 
     17check_contracts(); 
     18check_index(); 
     19check_tblstrct1(); 
     20check_tblstrct2(); 
     21check_tblstrct3(); 
     22check_tblstrct4(); 
    1323 
    1424if ($_POST['submit']) 
     
    2131    $config->checkCheckbox('ship_values'); 
    2232    $config->checkCheckbox('least_active'); 
     33    $config->checkCheckbox('adapt_items'); 
    2334 
    2435    if ($config->checkCheckbox('comments')) 
     
    5263$html .= "<tr><td width=120><b>Banner:</b></td><td><select id=style_banner name=style_banner>"; 
    5364 
    54 $dir = "img/banners/"; 
     65$dir = "img/logo/"; 
    5566if (is_dir($dir)) 
    5667{ 
     
    6071        { 
    6172            $file = substr($file, 0, strpos($file, ".")); 
    62             if (!is_dir($dir . $file)) 
     73            if (!is_dir($dir.$file)) 
    6374            { 
    64                 $html .= "<option value=\"" . $file . "\""; 
    65                 if ($file == $config->getStyleBanner()) 
     75                $html .= "<option value=\"".$file."\""; 
     76                if ($file == $config->getConfig('style_banner')) 
    6677                { 
    6778                    $html .= " selected=\"selected\""; 
    6879                } 
    69                 $html .= ">" . $file . "</option>"; 
     80                $html .= ">".$file."</option>"; 
    7081            } 
    7182        } 
     
    7384    } 
    7485} 
    75 $html .= "<option value=\"custom\""; 
    76 if ($config->getStyleBanner() == "custom") 
    77 { 
    78     $html .= " selected=\"selected\""; 
    79 } 
    80 $html .= ">custom</option></select></td></tr>"; 
     86$html .= "</td></tr>"; 
    8187$html .= "<tr><td width=120><b>Style:</b></td><td><select id=style_name name=style_name>"; 
    8288 
     
    8894        while (($file = readdir($dh)) !== false) 
    8995        { 
    90             if (is_dir($dir . $file)) 
     96            if (is_dir($dir.$file)) 
    9197            { 
    9298                if ($file == "." || $file == ".." || $file == ".svn") 
     
    94100                    continue; 
    95101                } 
    96                 $html .= "<option value=\"" . $file . "\""; 
    97                 if ($file == $config->getStyleName()) 
     102                $html .= "<option value=\"".$file."\""; 
     103                if ($file == $config->getConfig('style_name')) 
    98104                { 
    99105                    $html .= " selected=\"selected\""; 
    100106                } 
    101                 $html .= ">" . $file . "</option>"; 
     107                $html .= ">".$file."</option>"; 
    102108            } 
    103109        } 
     
    150156$html .= "<table class=kb-subtable>"; 
    151157 
    152 $html .= "<tr><td width=120><b>Post password:</b></td><td><input type=text name=post_password id=post_password size=20 maxlength=20 value=\"" . $config->getPostPassword() . "\"></td></tr>"; 
    153 $html .= "<tr><td width=120><b>Killmail CC:</b></td><td><input type=text name=post_mailto id=post_mailto size=20 maxlength=80 value=\"" . $config->getPostMailto() . "\"> (e-mail address)</td></tr>"; 
     158$html .= "<tr><td width=120><b>Post password:</b></td><td><input type=text name=post_password id=post_password size=20 maxlength=20 value=\"".$config->getPostPassword()."\"></td></tr>"; 
     159$html .= "<tr><td width=120><b>Killmail CC:</b></td><td><input type=text name=post_mailto id=post_mailto size=20 maxlength=80 value=\"".$config->getPostMailto()."\"> (e-mail address)</td></tr>"; 
    154160$html .= "<tr><td width=120><b>Mailhost:</b></td><td><input type=text name=post_mailhost id=post_mailhost size=20 maxlength=80 value=\"".$config->getConfig('mail_host')."\"></td></tr>"; 
    155 $html .= "<tr><td width=120><b>Disallow any killmails before:</b></td><td>" . dateSelector($config->getConfig('filter_apply'), $config->getConfig('filter_date')) . "</td></tr>"; 
     161$html .= "<tr><td width=120><b>Disallow any killmails before:</b></td><td>".dateSelector($config->getConfig('filter_apply'), $config->getConfig('filter_date'))."</td></tr>"; 
     162$html .= "<tr><td width=120><b>Enable auto-addition of unknown Items:</b></td><td><input type=checkbox name=adapt_items id=adapt_items"; 
     163if ($config->getConfig('adapt_items')) 
     164{ 
     165    $html .= " checked=\"checked\""; 
     166} 
     167$html .= "> (This is in case we can't supply a dump with the new items when Kali goes live)</td></tr>"; 
    156168$html .= "</table>"; 
    157169