You are here

function kwresearch_load_page_keywords_by_page in Keyword Research 6

Same name and namespace in other branches
  1. 7 kwresearch.module \kwresearch_load_page_keywords_by_page()

Loads an array of page keyword objects associated with a specific page

Parameters

int|str $key Int treated as kid, str as keyword phrase:

3 calls to kwresearch_load_page_keywords_by_page()
kwresearch_delete_page_keywords_by_page in ./kwresearch.module
Deletes all the page keyword for a given page
kwresearch_form_alter in ./kwresearch.module
Implementation of hook_form_alter().
kwresearch_nodeapi in ./kwresearch.module
Implementation of hook_nodeapi().

File

./kwresearch.module, line 587

Code

function kwresearch_load_page_keywords_by_page($pid) {
  $pn = kwresearch_construct_pathnid_obj($pid, $msgs);

  //dsm($pn);
  $sql = "\n    SELECT pk.*, k.keyword, k.priority AS site_priority, k.value AS value \n    FROM {kwresearch_page_keyword} pk\n    JOIN {kwresearch_keyword} k ON pk.kid = k.kid\n    WHERE path = '%s'\n  ";
  $result = db_query($sql, $pn->path);
  $page_keywords = array();
  while ($row = db_fetch_object($result)) {
    $page_keywords[] = $row;
  }
  return $page_keywords;
}