Ticket #558: ticket-558.patch

File ticket-558.patch, 1.5 KB (added by so1o, 5 years ago)

Changes for the fix..

  • bb-admin/themes.php

     
    1010 
    1111        $activetheme = bb_get_option('bb_active_theme'); 
    1212 
    13         $themes = bb_get_themes(); 
     13        $themes = array_keys(bb_get_themes()); 
    1414 
    1515        if ( !in_array($activetheme, $themes)) { 
    16                 $activetheme = BBPATH . 'bb-templates/kakumei'; 
     16                $activetheme = 'kakumei'; 
    1717                bb_update_option('bb_active_theme',$activetheme); 
    1818        } 
     19         
    1920?> 
    2021<h2><?php _e('Presentation'); ?></h2> 
    2122 
    22  
    2323<form method="post"> 
    2424        <?php 
    2525        foreach ($themes as $theme) : 
    2626                if ($theme == $activetheme) $checked = "checked='checked' "; else $checked = ""; 
    27                 $base = basename($theme); 
    28                 echo "<p><input type='radio' name='active_theme' value ='$theme' $checked/> $base</p>"; 
     27                echo "<p><input type='radio' id='active_theme_$theme' name='active_theme' value ='$theme' $checked/> <label for='active_theme_$theme'>$theme</label></p>"; 
    2928        endforeach; 
    3029        ?> 
    3130        <p class="submit"><input type="submit" name="submit" value="Make Default"></p> 
  • bb-includes/functions.php

     
    18641864} 
    18651865 
    18661866function bb_get_active_theme_folder() { 
    1867         $activetheme = bb_get_option( 'bb_active_theme' ); 
     1867        $themes = bb_get_themes(); 
     1868        $activetheme = $themes[bb_get_option( 'bb_active_theme' )]; 
    18681869        if ( !$activetheme ) 
    18691870                $activetheme = BBPATH . 'bb-templates/kakumei'; 
    18701871