I have a block that queries the database for node, however node can be translated into English / Spanish / ...
Is there a way to get the language selected by the user so that I can update the request to the type "And node.language = 'x'" (en / sp / ..)?
<?php
$args = explode("/",$_GET['q']);
$result = db_query("
SELECT node_revisions.body AS body FROM
{node} AS node
INNER JOIN {node_revisions} AS node_revisions ON node.vid = node_revisions.vid
INNER JOIN {term_node} AS term_node ON term_node.nid = node.nid
INNER JOIN {term_data} AS term_data ON term_data.tid = term_node.tid
WHERE term_data.name = '".$args[1]."' AND node.type = 'country_page'
LIMIT 1
", $user->uid);
while($row = db_fetch_object($result)){
echo($row->body);
}
?>
source
share