Advertisement
DrupalCustom

incfortheme

Jan 16th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. function freeway_user_mapping_non_global()
  2. {
  3. GLOBAL $user;
  4. $arrayNames = array();
  5.  
  6. //Query to obtain the number of users
  7. $result = db_query("SELECT name FROM {users} ");   
  8.     $rows = mysql_num_rows($result);
  9.    
  10.       if($rows==0){
  11.     drupal_set_message("There are curently no users!");
  12.     drupal_goto('user/'.$user->uid.'/freewayNonGlobalUser');
  13.   }
  14.   else{
  15.      while ($record  = db_fetch_object($result))
  16.      {
  17.      $userVal = $record->name;
  18.      $arrayNames[] = $userVal;
  19.      }
  20.  
  21.   }
  22.         for($i=1;$i<count($arrayNames);$i+=1){
  23.             $form[$arrayNames[$i]] = array('#value' =>  $arrayNames[$i]);
  24.            //$form[$fileId[$n]]['FileID'] = array('#value' =>  $fileId[$n]);
  25.         }
  26.  
  27.  
  28.  
  29. // user Theme Table for displaying the 3 columns.
  30.  
  31. //submit action.
  32.  
  33.  
  34. return $form;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement