getcomments

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

Description

getcomments( $m ); 

Parameters (1)

0. $m
The m.

Usage

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

Defined (1)

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

/src/xmlrpc-3.0/demo/server/discuss.php  
  1. function getcomments($m) 
  2. global $xmlrpcerruser; 
  3. $err=""; 
  4. $ra=array(); 
  5. // get the first param 
  6. if(XMLRPC_EPI_ENABLED == '1') 
  7. $msgID=xmlrpc_decode($m->getParam(0)); 
  8. else 
  9. $msgID=php_xmlrpc_decode($m->getParam(0)); 
  10. $dbh=dba_open("/tmp/comments.db", "r", "db2"); 
  11. if($dbh) 
  12. $countID="${msgID}_count"; 
  13. if(dba_exists($countID, $dbh)) 
  14. $count=dba_fetch($countID, $dbh); 
  15. for($i=0; $i<$count; $i++) 
  16. $name=dba_fetch("${msgID}_name_${i}", $dbh); 
  17. $comment=dba_fetch("${msgID}_comment_${i}", $dbh); 
  18. // push a new struct onto the return array 
  19. $ra[] = array( 
  20. "name" => $name,  
  21. "comment" => $comment 
  22. ); 
  23. // if we generated an error, create anerrorreturn response 
  24. if($err) 
  25. return new xmlrpcresp(0, $xmlrpcerruser, $err); 
  26. else 
  27. // otherwise, we create the right response 
  28. // with the state name 
  29. return new xmlrpcresp(php_xmlrpc_encode($ra));