function lingotek_get_node in Lingotek Translation 6
3 calls to lingotek_get_node()
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,
));
}
}