How to hide birth-year.
This is a practice to use checkboxes.
I. do ALTER TABLE
ALTER TABLE (prefix)_users ADD display_birthyear tinyint not null default 0;
II. edit templates
minihaku_edituser.html (edit minihaku_register.html too, if necessary)
<input type="checkbox" name="display_birthyear" id="display_birthyear" <{if $display_birthyear}>checked="checked"<{/if}> /><label for="display_birthyear">display your age</label>
$extra_fields = array(
'sex' => array(
'initval' => -1 ,
'options' => array( 0 => 'male' , 1 => 'female' ) ,
) ,
'birth' => array(
'initval' => '1950-01-01' ,
) ,
'display_birthyear' => array(
'initval' => false ,
) ,
) ;
if( empty( $minihaku_uid4whr ) ) {
foreach( $extra_fields as $key => $attribs ) {
$allowed_requests[$key] = $attribs['initval'] ;
}
} else {
$db =& Database::getInstance() ;
list( $allowed_requests['sex'] , $allowed_requests['birth'] , $allowed_requests['display_birthyear'] ) = $db->fetchRow( $db->query( "SELECT sex,birth,display_birthyear FROM ".$db->prefix("users")." WHERE uid=$minihaku_uid4whr" ) ) ;
$allowed_requests['sex'] = intval( $allowed_requests['sex'] ) ;
$allowed_requests['display_birthyear'] = (bool)$allowed_requests['display_birthyear'] ;
// for the plugin of modifier.minihaku_userinfo.php
$fields4html['sex'] = $extra_fields['sex']['options'][ $allowed_requests['sex'] ] ;
$fields4html['birth'] = str_replace( '-' , '/' , $allowed_requests['birth'] ) ;
if( ! $allowed_requests['display_birthyear'] ) $fields4html['birth'] = substr( $fields4html['birth'] , 5 ) ;
}