60a61,68
> 
>   $form['ignore_roles'] = array(
> 	'#type' => 'checkbox',
> 	'#title' => t('Ignore user settings.'),
> 	'#default_value' => variable_get('bueditor_ignore_roles',FALSE) ,
> 	'#description' => t('This can avoid conflicts with node type configuration.'),
>   );
> 
80a89,92
>   if( isset($edit['ignore_roles']) )
>   {
> 	variable_set('bueditor_ignore_roles',$edit['ignore_roles']);
>   }
172a185,192
> 
>   $form['editor']['ntypes'] = array(
>   '#type' => 'checkboxes',
>   '#title' => t('Node types to show the editor in'),
>   '#default_value' => $new ? array() : $editor->ntypes ,
>   '#options' => node_get_types('names'),
>   );
> 
227c247
<   $vis = theme('fieldset', array('#title' => t('Visibility settings'), '#children' => drupal_render($form['editor']['pages']). drupal_render($form['editor']['excludes']), '#collapsible' => TRUE, '#collapsed' => $eid != 'new',));
---
>   $vis = theme('fieldset', array('#title' => t('Visibility settings'), '#children' => drupal_render($form['editor']['pages']) .  drupal_render($form['editor']['ntypes']) . drupal_render($form['editor']['excludes']), '#collapsible' => TRUE, '#collapsed' => $eid != 'new',));
241a262
>   $edit['editor']['ntypes'] = base64_encode(serialize($edit['editor']['ntypes']));
326a348
>   
366a389
> 
373c396,406
<   if (!$qall) return isset($editors) ? $editors[$eid] : db_fetch_object(db_query("SELECT * FROM {bueditor_editors} WHERE eid = %d", $eid));
---
> 
>   if (!$qall){
> 	if(isset($editors))
> 		return $editors[$eid];
> 	else {
> 		$_editor = db_fetch_object(db_query("SELECT * FROM {bueditor_editors} WHERE eid = %d", $eid)) ;
> 		$_editor->ntypes = unserialize(base64_decode( $_editor->ntypes ));
> 		return $_editor;
> 	}
>   }
> 
377a411
> 	$editor->ntypes = unserialize(base64_decode( $editor->ntypes ));
488,489c522,543
<     $editor = bueditor_user_editor($GLOBALS['user']);
<     $pageok = $editor->pages ? bueditor_check_match($editor->pages, $_GET['q']) : FALSE;
---
> 
>    //get node type
>    if (arg(0) == 'node' && is_numeric(arg(1)))
>    {
>    	$node = node_load(arg(1));
> 	$node_type = $node->type;
>    }
>    else {
> 	//get the type of node that is being created
>       $node_type = substr (strrchr ($_GET["q"], "/"), 1);
>    }
> 
>    //check if roles are ignored
>    if (variable_get("bueditor_ignore_roles",FALSE))
>    {
> 	$editor = bueditor_node_editor($node_type);
>    }
>    else {
>       $editor = bueditor_user_editor($GLOBALS['user']);
>    }
> 
>    $pageok = $editor->pages ? bueditor_check_match($editor->pages, $_GET['q']) : FALSE;
576a631,643
> }
> 
> 
> /**
>  * Return the editor assigned to the node type.
>  */
> function bueditor_node_editor($node_type) {
> 	$editors = bueditor_editors('all');
> 	foreach ($editors as $key=>$editor)
> 	{
> 		if( $editor->ntypes[$node_type] ) { return $editor; }
> 	}
> 	return FALSE;
