You are here

function contentoptimizer_node_submit in Content Optimizer 6

1 string reference to 'contentoptimizer_node_submit'
contentoptimizer_form_alter in ./contentoptimizer.module
Implementation of hook_form_alter().

File

./contentoptimizer.module, line 106
Analyzes node content for search engine optimization recommendations

Code

function contentoptimizer_node_submit($form, &$form_state) {

  //print "contentoptimizer_node_submit($form,$form_state)";

  //print_r($form_state);
  $sql = '
    UPDATE {contentoptimizer_keyword}
    SET keyword = "%s"
    WHERE nid = %d
  ';
  db_query($sql, $form_state['values']['contentoptimizer']['keyword'], $form_state['values']['nid']);
  if (!db_affected_rows()) {
    $sql = '
  	  INSERT INTO {contentoptimizer_keyword}
  	  (nid,keyword) VALUES
  	  (%d,"%s")
  	';
    db_query($sql, $form_state['values']['nid'], $form_state['values']['contentoptimizer']['keyword']);
  }
}