Advertisement
DrupalCustom

sdf

Feb 22nd, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. function freeway_node_load($node, $types) {
  2. global $language;
  3.  
  4. foreach($node as $n){
  5. $tempId = $n->nid;
  6. $tempSrcLang = $n->language;
  7. }
  8. $tempTarLang = $language->language;
  9.  
  10.   if ($tempSrcLang == en) {
  11.     $nodeSrc = 'en-us';
  12.  
  13.   }
  14.   if ($tempTarLang == fr) {
  15.     $frewayLang = 'fr-fr';
  16.   }
  17.   if ($tempTarLang == es) {
  18.     $frewayLang = 'es-es';
  19.   }
  20.  
  21.  
  22.  
  23.   // TODO Please convert this statement to the D7 database API syntax.
  24.   $result = db_query("SELECT node_title,node_body FROM {freeway}
  25.                      WHERE node_id = '$tempId'
  26.                      AND src_lang ='$nodeSrc'
  27.                      AND tar_lang='$frewayLang'");
  28.  
  29. $rowsUsPw = $result->rowCount();
  30.  
  31.  
  32.   foreach ($result as $record) {
  33.   foreach($node as $inner){
  34.                                    
  35.         $inner->body['und'][0]['value']= $record->node_body.'French';
  36.         $inner->title = $record->node_title.'French';
  37.    
  38.     }
  39.    
  40.   }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement