Results 1 to 8 of 8
-
14th Feb 2012, 10:20 AM #1OPMemberWebsite's:
satiq.netProblem with Xmlrpc
Hi, I made a simple script in php that I insert title, content, image, and it posts to my wordpress blog with xmlrpc.
The problem is that my post has wrong layout.
For example, if I insert:
Code:<a href="http://www.pixhost.org/show/111/111_somepic.jpg"><img src="http://www.pixhost.org/show/111/111_somepic.jpg" alt="http://www.pixhost.org/show/111/111_somepic.jpg" border="0"/></a>
I tried to use htmlspecialchars(), but it's worst; I see post as html source..
How can I correct that error?skinner Reviewed by skinner on . Problem with Xmlrpc Hi, I made a simple script in php that I insert title, content, image, and it posts to my wordpress blog with xmlrpc. The problem is that my post has wrong layout. For example, if I insert: <a href="http://www.pixhost.org/show/111/111_somepic.jpg"><img src="http://www.pixhost.org/show/111/111_somepic.jpg" alt="http://www.pixhost.org/show/111/111_somepic.jpg" border="0"/></a> I see in post some space between tags and wordpress doesn't recognize as image and, instead, write html code. Rating: 5
-
14th Feb 2012, 11:33 AM #2Member
It may be because wp automatically formats your posts.
Try http://wordpress.org/extend/plugins/disable-wpautop/
-
14th Feb 2012, 12:49 PM #3OPMemberWebsite's:
satiq.netI still have this stupid problem:
Code:<img src="http://t2.pixhost.org/thumbs/111/1111_aa_aa.jpg"
Thanks
-
14th Feb 2012, 01:24 PM #4MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comdont use htmlspecialchars();
JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
14th Feb 2012, 01:25 PM #5MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comfor me is working with no special function, maybe depends on how you post.
Can you post the code you are using?
-
14th Feb 2012, 02:34 PM #6OPMemberWebsite's:
satiq.netI'm using that function:
PHP Code:function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$category,$keywords='',$encoding='UTF-8') {
$title = htmlentities($title,ENT_NOQUOTES,$encoding);
$keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);
$content = array(
'title'=>$title,
'description'=>$body,
'mt_allow_comments'=>1, // 1 to allow comments
'mt_allow_pings'=>1, // 1 to allow trackbacks
'post_type'=>'post',
'mt_keywords'=>$keywords,
'categories'=>array($category)
);
$params = array(0,$username,$password,$content,true);
$request = xmlrpc_encode_request('metaWeblog.newPost',$params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_URL, $rpcurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
$results = curl_exec($ch);
curl_close($ch);
return $results;
}
-
14th Feb 2012, 02:44 PM #7MemberWebsite's:
wscripts.net damnlolscript.com lulzjet.comworking fine for me, image is working in post
-
14th Feb 2012, 02:48 PM #8OPMemberWebsite's:
satiq.netIf I look at the source of the post I see:
Code:<a href="http://t2.pixhost.org/thumbs/111/1111_aa_aa.jpg"><img src="http://t2.pixhost.org/thumbs/111/1111_aa_aa.jpg" alt="sssss" border="0"/></a>
Edit:
Now it seems work with that function:
PHP Code:$postbody = htmlspecialchars_decode($postbody);
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Xmlrpc and Cloudflare
By skinner in forum Web Development AreaReplies: 4Last Post: 30th May 2012, 09:08 AM -
You don't have permission to access /xmlrpc.php on this server.
By sSKKa in forum Webmaster DiscussionReplies: 8Last Post: 3rd Dec 2011, 03:27 PM -
[HELP] How to install PHP-XMLRPC on CentOS?
By ChaoscripT in forum Server ManagementReplies: 2Last Post: 19th Nov 2011, 07:45 PM -
error while using xmlrpc
By chems in forum WordpressReplies: 1Last Post: 31st Jul 2011, 12:34 PM -
Help installing php with xmlrpc.mysql,apache
By lukip006 in forum Technical Help Desk SupportReplies: 8Last Post: 20th Mar 2011, 04:34 AM
themaCreator - create posts from...
Version 3.55 released. Open older version (or...