You are here

function lingotek_get_node in Lingotek Translation 6

3 calls to lingotek_get_node()
lingotek_translated_menu_link_alter in ./lingotek.module
lingotek_update in ./lingotek.page.inc
lingotek_update_nodes in ./lingotek.sync.inc

File

./lingotek.api.inc, line 265

Code

function lingotek_get_node($lang_prefix, $tnid) {
  $result = db_query("SELECT n.nid FROM {node} n INNER JOIN {lingotek} ln ON n.nid = ln.nid AND ln.lingokey = 'tnid' WHERE n.language = '%s' AND ln.lingovalue = '%s'", $lang_prefix, $tnid);
  $row = db_fetch_object($result);
  if ($row) {
    return node_load(array(
      'nid' => $row->nid,
    ));
  }
  else {
    return node_load(array(
      'language' => $lang_prefix,
      'tnid' => $tnid,
    ));
  }
}