"; exit(); } function dispatch($client, $method, $args) { $msg=new xmlrpcmsg($method, $args); $resp=$client->send($msg); if (!$resp) { print "
IO error: ".$client->errstr."
"; bomb(); } if ($resp->faultCode()) { print "There was an error: " . $resp->faultCode() . " " . $resp->faultString() . "
"; bomb(); } return php_xmlrpc_decode($resp->value()); } // create client for discussion server $dclient=new xmlrpc_client("${mydir}/discuss.php", "xmlrpc.usefulinc.com", 80); // check if we're posting a comment, and send it if so @$storyid=$_POST["storyid"]; if ($storyid) { // print "Returning to " . $HTTP_POST_VARS["returnto"]; $res=dispatch($dclient, "discuss.addComment", array(new xmlrpcval($storyid), new xmlrpcval(stripslashes (@$_POST["name"])), new xmlrpcval(stripslashes (@$_POST["commenttext"])))); // send the browser back to the originating page Header("Location: ${mydir}/comment.php?catid=" . $_POST["catid"] . "&chanid=" . $_POST["chanid"] . "&oc=" . $_POST["catid"]); exit(0); } // now we've got here, we're exploring the story store ?>" . $v['title'] . " "; print $v['description'] . " "; print "Read full story "; print "Comment on this story"; print ""; print " | ";
print "\n";
// now look for existing comments
$res=dispatch($dclient, "discuss.getComments",
array(new xmlrpcval($v['id'])));
if (sizeof($res)>0) {
print "
" . "Comments on this story: "; for($i=0; $i"; print "Comment: " . htmlentities($s['comment']) . ""; } print " |