Show
Ignore:
Timestamp:
05/10/07 15:17:09 (16 years ago)
Author:
ralle030583
Message:

- new table kb3_navigation
- new Admin Section Navigation - Top Navigation
- removes customable top nav bar changes which came with last revs
- new tablestruct added to autoupgrade.php
- db_cache error when creating new table fixed

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/includes/autoupgrade.php

    r201 r216  
    1212    } 
    1313    $query = 'CREATE TABLE `kb3_comments` ( 
    14 `ID` INT NOT NULL AUTO_INCREMENT , 
    15 `kll_id` INT NOT NULL , 
    16 `comment` TEXT NOT NULL , 
    17 `name` TINYTEXT NOT NULL , 
    18 `posttime` TIMESTAMP DEFAULT \'0000-00-00 00:00:00\' NOT NULL, 
    19 PRIMARY KEY ( `ID` ) 
    20 ) TYPE = MYISAM'; 
    21     $qry->execute($query); 
    22 } 
     14        `ID` INT NOT NULL AUTO_INCREMENT , 
     15        `kll_id` INT NOT NULL , 
     16        `comment` TEXT NOT NULL , 
     17        `name` TINYTEXT NOT NULL , 
     18        `posttime` TIMESTAMP DEFAULT \'0000-00-00 00:00:00\' NOT NULL, 
     19        PRIMARY KEY ( `ID` ) 
     20        ) TYPE = MYISAM'; 
     21    $qry->execute($query); 
     22} 
     23 
     24function check_navigationtable(){ 
     25        $qry = new DBQuery(); 
     26        $query = 'select count(*) from kb3_navigation'; 
     27        $result = mysql_query($query); 
     28        if ($result) 
     29        { 
     30            return; 
     31        } 
     32        $query = 'CREATE TABLE `kb3_navigation` ( 
     33        `ID` INT NOT NULL AUTO_INCREMENT , 
     34        `nav_type` TINYTEXT NOT NULL, 
     35        `intern` INT ( 1 ) NOT NULL,  
     36        `descr` TINYTEXT NOT NULL , 
     37        `url` TINYTEXT NOT NULL , 
     38        `target` VARCHAR( 10 )  NOT NULL, 
     39        `posnr` INT NOT NULL, 
     40        `page` TINYTEXT NOT NULL, 
     41        PRIMARY KEY ( `ID` ) 
     42        ) TYPE = MYISAM'; 
     43           $qry->execute($query); 
     44        if (CORP_ID) 
     45        { 
     46            $statlink = '?a=corp_detail&crp_id='.CORP_ID; 
     47        } 
     48        elseif (ALLIANCE_ID) 
     49        { 
     50            $statlink = '?a=alliance_detail&all_id='.ALLIANCE_ID; 
     51        } 
     52        $queries = "INSERT IGNORE INTO `kb3_navigation` VALUES (1,'top',1,'Home','?a=home','_self',1,'ALL_PAGES'); 
     53                INSERT IGNORE INTO `kb3_navigation` VALUES (2,'top',1,'Campaings','?a=campaigns','_self',2,'ALL_PAGES'); 
     54                INSERT IGNORE INTO `kb3_navigation` VALUES (3,'top',1,'Contracts','?a=contracts','_self',3,'ALL_PAGES'); 
     55                INSERT IGNORE INTO `kb3_navigation` VALUES (4,'top',1,'Kills','?a=home','_self',4,'ALL_PAGES'); 
     56                INSERT IGNORE INTO `kb3_navigation` VALUES (5,'top',1,'Losses','?a=losses','_self',5,'ALL_PAGES'); 
     57                INSERT IGNORE INTO `kb3_navigation` VALUES (6,'top',1,'Post Mail','?a=post','_self',6,'ALL_PAGES'); 
     58                INSERT IGNORE INTO `kb3_navigation` VALUES (7,'top',1,'Stats','$statlink','_self',7,'ALL_PAGES'); 
     59                INSERT IGNORE INTO `kb3_navigation` VALUES (8,'top',1,'Awards','?a=awards','_self',8,'ALL_PAGES'); 
     60                INSERT IGNORE INTO `kb3_navigation` VALUES (9,'top',1,'Standings','?a=standings','_self',9,'ALL_PAGES'); 
     61                INSERT IGNORE INTO `kb3_navigation` VALUES (10,'top',1,'Search','?a=search','_self',10,'ALL_PAGES'); 
     62                INSERT IGNORE INTO `kb3_navigation` VALUES (11,'top',1,'Admin','?a=admin','_self',11,'ALL_PAGES'); 
     63                INSERT IGNORE INTO `kb3_navigation` VALUES (12,'top',1,'About','?a=about','_self',12,'ALL_PAGES');"; 
     64        $query = explode("\n", $queries); 
     65        foreach ($query as $querystring) 
     66        { 
     67                if ($string = trim(str_replace(');', ')', $querystring))) 
     68                { 
     69                    $qry->execute($string); 
     70                } 
     71        } 
     72}        
    2373 
    2474function check_commenttablerow()