You are here

function contentoptimizer_set_keyword in Content Optimizer 6.2

Same name and namespace in other branches
  1. 8 contentoptimizer.module \contentoptimizer_set_keyword()
  2. 7.2 contentoptimizer.module \contentoptimizer_set_keyword()

Saves keyword to databse

Parameters

int $aid: analysis id of analysis keyword is associated with

str $keyword: keyword to save

2 calls to contentoptimizer_set_keyword()
contentoptimizer_analyzer in ./contentoptimizer.module
Implementation of hook_contentanalysis_analyzer() via custom define callback
contentoptimizer_node_form_submit in ./contentoptimizer.module
Implementation of hook_contentanalysis_node_form_submit() via custom define callback

File

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

Code

function contentoptimizer_set_keyword($aid, $keyword) {
  $sql = "\n    UPDATE {contentoptimizer}\n    SET keyword = '%s'\n    WHERE aid = %d\n  ";
  db_query($sql, $keyword, $aid);
  if (!(db_affected_rows() > 0)) {
    $sql = "\n      INSERT INTO {contentoptimizer}\n      (aid,keyword) VALUES\n      (%d,'%s')\n    ";
    db_query($sql, $aid, $keyword);
  }
}