Ignore:
Timestamp:
Mar 1, 2011, 11:40:34 AM (10 years ago)
Author:
cljosse
Message:

[edit_gmaps] set conformity with rv_gmaps install.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/edit_gmaps/admin/admin.php

    r9412 r9445  
    22if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    33include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
    4 
    5 $colonnes = cl_get_columns_of(IMAGES_TABLE);
    6 
    7 $key = array_search('lon', $colonnes[IMAGES_TABLE]);
    8 if (!$key){
    9     $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lon` DOUBLE(9,6)';
    10     pwg_query($q);     
    11 }       
    12 $key = array_search('lat', $colonnes[IMAGES_TABLE]);
    13 if (!$key){
    14     $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `lat` DOUBLE(9,6)';
    15     pwg_query($q);     
    16 }       
    17 $key = array_search('alt', $colonnes[IMAGES_TABLE]);
    18 if (!$key){
    19     $q = 'ALTER TABLE '.IMAGES_TABLE.' ADD COLUMN `alt` DOUBLE(9,6)';
    20     pwg_query($q);     
    21 }       
    22 
    23        
    24 /**
    25 * list all columns of each given table
    26 *
    27 * @return array of array
    28 */
    29 function cl_get_columns_of($table)
    30 {
    31     $columns_of = array();
    32     $query = 'DESC '.$table.';';
    33     $result = mysql_query($query);     
    34     $columns_of[$table] = array();   
    35 
    36     if ($result)   
    37         while ($row = mysql_fetch_row($result))
    38            array_push($columns_of[$table], $row[0]);
    39        
    40     return $columns_of;
    41 }
    424
    435
Note: See TracChangeset for help on using the changeset viewer.