Ignore:
Timestamp:
Jan 21, 2024, 12:39:07 PM (4 months ago)
Author:
ddtddt
Message:

[see_photos_by_user] section user- / updae history and enum

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/see_photos_by_user/maintain.class.php

    r32937 r33008  
    5959        conf_update_param('see_photos_by_user_shape', 'sphere',true);
    6060    }
    61  
     61       
     62        pwg_query('UPDATE '.HISTORY_TABLE.' SET section = \'user-\' WHERE section like \'user-%\'');
     63        $history_sections = get_enums(HISTORY_TABLE, 'section');
     64        foreach ($history_sections as $key => $value) {
     65        if (substr($value,0,5) == 'user-') {
     66            unset($history_sections[$key]);
     67        }
     68    }
     69        $history_sections[]='user-';
     70        pwg_query('ALTER TABLE '.HISTORY_TABLE.' CHANGE section section enum(\''.implode("','", array_unique($history_sections)).'\') DEFAULT NULL;');
     71        conf_update_param('history_sections_cache', get_enums(HISTORY_TABLE, 'section'), true);
     72   
    6273  }
    6374
     
    8697        conf_update_param('see_photos_by_user_shape', 'sphere',true);
    8798    }
     99       
     100        pwg_query('UPDATE '.HISTORY_TABLE.' SET section = \'user-\' WHERE section like \'user-%\'');
     101        $history_sections = get_enums(HISTORY_TABLE, 'section');
     102        foreach ($history_sections as $key => $value) {
     103        if (substr($value,0,5) == 'user-') {
     104            unset($history_sections[$key]);
     105        }
     106    }
     107        $history_sections[]='user-';
     108        pwg_query('ALTER TABLE '.HISTORY_TABLE.' CHANGE section section enum(\''.implode("','", array_unique($history_sections)).'\') DEFAULT NULL;');
     109        conf_update_param('history_sections_cache', get_enums(HISTORY_TABLE, 'section'), true);
     110       
    88111  }
    89112 
Note: See TracChangeset for help on using the changeset viewer.