Posts (page 2)
Well, If you just set the collation as "utf8-general-ci" that wont do all the things for storing and retrieving bangla unicode texts properly. There are something more to do. Last night while working for a project I just found the solution.
You must add these two lines just after selecting the database, i.e mysql_select_db() function.
mysql_query('SET CHARACTER SET utf8');
mysql_query("SET SESSION collation_connection ='utf8_general_ci'");
After executing these two statements MySQL will handle the rest.
Almost every standard compliant blogs support three blogging API which are "Blogger API" , "MovableType API" and "MetaWeblog API". Among these MW (or MetaWeblog) is used more than other two. Wordpress also supporst these three sets of API. If you are interesetd how to interact with these API's - then take a look at the following example.
First lets discover which XMLRPC methods are suported by wordpress XMLRPC server. Just execute the following script
system.multicall
system.listMethods
system.getCapabilities
demo.addTwoNumbers
demo.sayHello
pingback.extensions.getPingbacks
pingback.ping
mt.publishPost
mt.getTrackbackPings
mt.supportedTextFilters
mt.supportedMethods
mt.setPostCategories
mt.getPostCategories
mt.getRecentPostTitles
mt.getCategoryList
metaWeblog.getUsersBlogs
metaWeblog.setTemplate
metaWeblog.getTemplate
metaWeblog.deletePost
metaWeblog.newMediaObject
metaWeblog.getCategories
metaWeblog.getRecentPosts
metaWeblog.getPost
metaWeblog.editPost
metaWeblog.newPost
blogger.deletePost
blogger.editPost
blogger.newPost
blogger.setTemplate
blogger.getTemplate
blogger.getRecentPosts
blogger.getPost
blogger.getUserInfo
blogger.getUsersBlogs
so to make a new post using metaWeblog.newPost method lets take a look at the following example.
<?php
include("xmlrpc.inc.php");
$c = new xmlrpc_client("/wp/xmlrpc.php", "localhost", 80);
$content['title']="XMLRPC Post";
$content['description']="Some content posted using MetaWeblog API";
$content['categories'] = array("frontpage");
$x = new xmlrpcmsg("metaWeblog.newPost",
array(php_xmlrpc_encode("1"),
php_xmlrpc_encode("admin"),
php_xmlrpc_encode("root"),
php_xmlrpc_encode($content),
php_xmlrpc_encode("1")));
$c->return_type = 'phpvals';
$r =$c->send($x);
if ($r->errno=="0")
echo "Successfully Posted";
else {
echo "There are some error";
print_r($r);
}
?>
Thats it!!