Changeset 217

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

- add new Button to Administration - Navigation - Top Navigation
for reparing the stats link ;-)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dev/common/admin/admin_navmanager.php

    r216 r217  
    3131        delPage($_POST['id']); 
    3232} 
     33if ($_POST['syncStat']){ 
     34        repairStatLink(); 
     35} 
    3336//Reading global Navigation Bar 
    3437$html .= "<div class=block-header2>Navigation for intern pages</div>"; 
     
    4447        while ($row = $qry->getRow()) 
    4548        { 
     49                 $html .= "<tr class=$class><td>".$row['descr']."</td><form action ='$PHP_SELF' method='POST'><td><input name='name' type='text' value='".$row['descr']."'></td><td><input type='hidden' name='id' value='".$row['ID']."'><input type='submit' value='rename'></td></form></tr>"; 
    4650                if (!$odd) 
    4751        { 
     
    5458            $class = 'kb-table-row-even'; 
    5559        } 
    56                 $html .= "<tr class=$class><td>".$row['descr']."</td><form action ='$PHP_SELF' method='POST'><td><input name='name' type='text' value='".$row['descr']."'></td><td><input type='hidden' name='id' value='".$row['ID']."'><input type='submit' value='rename'></td></form></tr>"; 
    57         } 
     60        } 
     61        $html .= "<tr class=$class>"; 
     62        if (!$odd) 
     63    { 
     64        $odd = true; 
     65        $class = 'kb-table-row-odd'; 
     66    } 
     67    else 
     68    { 
     69        $odd = false; 
     70        $class = 'kb-table-row-even'; 
     71    } 
     72        $html .= "<tr class=$class><form action ='$PHP_SELF' method='POST'><td colspan = 3><input type='hidden' name='syncStat' value='1'><center><input type='submit' value='Repair Stat Link'></center></td></form></tr>"; 
    5873        $html .= "</table>"; 
    5974}        
     
    183198         
    184199        $qry = new DBQuery(); 
    185         $query = "UPDATE kb3_navigation SET posnr = (posnr-1) WHERE ID = $id"; 
     200        $query = "UPDATE kb3_navigation SET posnr = (posnr-1) WHERE ID = $id    "; 
    186201        $qry->execute($query); 
    187202} 
     
    217232        $qry->execute($query); 
    218233} 
     234function repairStatLink(){ 
     235        if (CORP_ID) 
     236        { 
     237            $statlink = '?a=corp_detail&crp_id='.CORP_ID; 
     238        } 
     239        elseif (ALLIANCE_ID) 
     240        { 
     241            $statlink = '?a=alliance_detail&all_id='.ALLIANCE_ID; 
     242        } 
     243        $qry = new DBQuery(); 
     244        $query = "UPDATE kb3_navigation SET url ='$statlink' WHERE ID=7"; 
     245        $qry->execute($query); 
     246} 
    219247?>