Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function freeway_node_load($node, $types) {
- global $language;
- foreach($node as $n){
- $tempId = $n->nid;
- $tempSrcLang = $n->language;
- }
- $tempTarLang = $language->language;
- if ($tempSrcLang == en) {
- $nodeSrc = 'en-us';
- }
- if ($tempTarLang == fr) {
- $frewayLang = 'fr-fr';
- }
- if ($tempTarLang == es) {
- $frewayLang = 'es-es';
- }
- // TODO Please convert this statement to the D7 database API syntax.
- $result = db_query("SELECT node_title,node_body FROM {freeway}
- WHERE node_id = '$tempId'
- AND src_lang ='$nodeSrc'
- AND tar_lang='$frewayLang'");
- $rowsUsPw = $result->rowCount();
- foreach ($result as $record) {
- foreach($node as $inner){
- drupal_get_messages();
- //drupal_set_message("RecordArray>".$record->node_body);
- drupal_set_message('<pre>'. print_r($node, true) .'</pre>');
- drupal_goto("user");
- //$inner->body['und'][0]['value']= $record->node_body;
- //$inner->body['und'][0]['value']= 'Test';
- $inner->title = $record->node_title.'French';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement