findstate

The Contact Form 7 - Infusionsoft Add-on findstate function.

Description

findstate( $m ); 

Parameters (1)

0. $m
The m.

Usage

  1. if ( !function_exists( 'findstate' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7-infusionsoft-add-on/src/xmlrpc-3.0/demo/server/server.php'; 
  3.  
  4. // The m. 
  5. $m = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = findstate($m); 
  9.  

Defined (1)

The function is defined in the following location(s).

/src/xmlrpc-3.0/demo/server/server.php  
  1. function findstate($m) 
  2. global $xmlrpcerruser, $stateNames; 
  3. $err=""; 
  4. // get the first param 
  5. $sno=$m->getParam(0); 
  6.  
  7. // param must be there and of the correct type: server object does the 
  8. // validation for us 
  9.  
  10. // extract the value of the state number 
  11. $snv=$sno->scalarval(); 
  12. // look it up in our array (zero-based) 
  13. if (isset($stateNames[$snv-1])) 
  14. $sname=$stateNames[$snv-1]; 
  15. else 
  16. // not, there so complain 
  17. $err="I don't have a state for the index '" . $snv . "'"; 
  18.  
  19. // if we generated an error, create anerrorreturn response 
  20. if ($err) 
  21. return new xmlrpcresp(0, $xmlrpcerruser, $err); 
  22. else 
  23. // otherwise, we create the right response 
  24. // with the state name 
  25. return new xmlrpcresp(new xmlrpcval($sname));