Changeset 33008


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

Location:
extensions/see_photos_by_user
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/see_photos_by_user/main.inc.php

    r32937 r33008  
    6262                    $userok[] = $row['id'];
    6363                }
     64
     65                                $page['section'] = 'user-';
    6466                if (in_array($testd[0], $userok)) {
    6567                    $me = 'user-' . $testd[0].'-'.$username;
  • 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 
  • extensions/see_photos_by_user/pagespba.php

    r32937 r33008  
    2929    $username= see_username($testd[0]);
    3030    $me = 'user-' . $testd[0].'-'.$username;
    31     $page['section'] = $me;
     31    $page['section'] = 'user-';
    3232    $page['section_title'] = '<a href="' . get_absolute_root_url() . '">' . l10n('Home') . '</a>' . $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/user-">' . l10n('Users').'</a>'. $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/' . $me . '">'.$username. '</a>';
    3333    $template->assign(
     
    7373 global $page, $conf, $user, $template;
    7474 $me = 'user-';
    75  $page['section'] = $me;
     75 $page['section'] = 'user-';
    7676 $page['section_title'] = '<a href="' . get_absolute_root_url() . '">' . l10n('Home') . '</a>' . $conf['level_separator'] . '<a href="' . get_absolute_root_url() . 'index.php?/' . $me . '">' . l10n('Users') . '</a>';       
    7777 $userslistecloud1 = see_userlist_nb_photo();
Note: See TracChangeset for help on using the changeset viewer.