[ Home ] [ Idea ] [ Submit News using XML–RPC] [ Submit News ] [ Nuke 4.3 Integration ] [ Display News ] [ Add RSS ] [ Task List ] [ Discussion Forums ] [ Retrieve News in XML ] [ Channel ] [ Screen Shots ] [ Archives ] [ Tutorial for retrieving news ] [ Tutorial for submitting news ] [ Download OCS Directory ]

To submit news to NGOID News Network

The XML – RPC interface provided at NGOID news network to submit news items is PostNews.php. To post articles in NGOID news network, a XML – RPC call has to be made to PostNews.php.

PostNews.php : This file takes care of inserting data into "NGOID news network" database. It contains one function named SubmitNewsNgoid. The function definition is as follows

function SubmitNewsNgoid($params)
$params is an object of XML–RPC Message type. This message contains 6 parameters. They are as follows

  1. subject: The subject of the article
  2. story: The story description
  3. topic_Name: The topic under which the article falls
  4. name: The name of the person who authored the article
  5. URL: The URL of the site
  6. SiteName: The Name of the site

Eg: Java V/s C++

Java is completely object oriented. C++ supports use of pointers, whereas Java doesnt.
- "Anonymous"

subject: Java V/s c++
story: the entire description
topic_name: Object Oriented Programming concepts
name: Anonymous
URL: http://gyanquest.net
Sitename: GyanQuest

Here is a sample code that submits the above article with the news network. The code is written in PHP.To rewrite the code in other languages, refer to documentation provided at www.xmlrpc.com

<?
$rpc_message = new xmlrpcmsg('i3c.ngoiddb',array(new xmlrpcval($subject,"string"),new xmlrpcval($story,"string"),new xmlrpcval($topic_name,"string"),new xmlrpcval($name,"string"),new xmlrpcval($url,"string"),new xmlrpcval($sitename,"string")));
$rpc_client = new xmlrpc_client("/PostNews.php","ngoid.sourceforge.net",80);
$recieve=$rpc_client->send($rpc_message);
$value=$recieve->value();
?>

The database used on the NGOID Server is a MySQL database, currently it has one table named stories. The stories table has the following fields

  1. storyid - Primary Key Auto Increment
  2. title - varchar(80)
  3. time - datetime
  4. storydescription - text
  5. topicname varchar(80)
  6. username varchar(25)
  7. urlsite varchar(80)
  8. SiteName varchar(50)

Code for integration of an information portal with the news network is available. The example shows integration with a PHP–Nuke 4.3 based portal. ( http://www.gyanquest.net).PHP–Nuke is a news automated system specially designed to be used in Intranets and Internet. Thanks to the PHP–Nuke team for coming out with an excellent information portal.

Source Forge

We use resources from Source Forge to run this project and would like to thank them for giving back to the community.

For more details on NGOID, Click here