1
我想通過直接將數據插入mySQl數據庫,以編程方式在我的Word新聞MultiSite上與用戶同時創建博客。我一直在尋找互聯網,但沒有實施這個運氣。Wordpress Multi-Site - 以編程方式創建用戶
Wordpress Multi Site (Networking enabled)似乎是一個類似的問題,但我似乎無法實施在那裏提供的解決方案。任何人都可以幫助實現這個基礎?
感謝
我想通過直接將數據插入mySQl數據庫,以編程方式在我的Word新聞MultiSite上與用戶同時創建博客。我一直在尋找互聯網,但沒有實施這個運氣。Wordpress Multi-Site - 以編程方式創建用戶
Wordpress Multi Site (Networking enabled)似乎是一個類似的問題,但我似乎無法實施在那裏提供的解決方案。任何人都可以幫助實現這個基礎?
感謝
您應該使用WordPress的插件,多地點。你here只是不得不做出一個方法調用創建新博客與下multi-site.Here新的路徑是使用Apache XML-RPC API的例子
public class Demo
{
public static void main(String[] args)
{
System.out.println("Starting adicXmlRpcServer test");
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
try
{
config.setServerURL(new URL("http://localhost/wordpress/xmlrpc.php"));
}
catch (MalformedURLException ex)
{
System.out.println("Invalid url....."+ex.getMessage());
ex.printStackTrace();
}
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
Map map = new HashMap();
map.put("domain","localhost");
map.put("path","/newStrore");
map.put("title","newStrore");
map.put("user_id","[email protected]");
Object[] params = new Object[] {new String("admin"),new String("9868"),map};
try
{
Object result = (Object) client.execute("ms.CreateBlog",params);
ArrayList<String> dirListing = new ArrayList<String>();
System.out.println(result.toString());
}
catch (XmlRpcException ex)
{
System.out.println("Invalid url....."+ex.getMessage());
ex.printStackTrace();
}
}
}