Activity Stream
48,167 MEMBERS
6674 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 8 of 8
  1.     
    #1
    Member
    Website's:
    satiq.net

    Default 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:

    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 see in post some space between tags and wordpress doesn't recognize as image and, instead, write html code.

    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

  2.   Sponsored Links

  3.     
    #2
    Member
    It may be because wp automatically formats your posts.
    Try http://wordpress.org/extend/plugins/disable-wpautop/

  4.     
    #3
    Member
    Website's:
    satiq.net
    I still have this stupid problem:

    Code: 
    <img src="http://t2.pixhost.org/thumbs/111/1111_aa_aa.jpg&quot;
    It doesn't add " at the end of src tag.. but if I stamp with an echo, the link is working well..

    Thanks

  5.     
    #4
    Member
    Website's:
    tehMoviez.com 0Senes.com GeekFaceGames.com
    dont use htmlspecialchars();

  6.     
    #5
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    for me is working with no special function, maybe depends on how you post.
    Can you post the code you are using?

  7.     
    #6
    Member
    Website's:
    satiq.net
    I'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($chCURLOPT_POSTFIELDS$request);
        
    curl_setopt($chCURLOPT_URL$rpcurl);
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
    curl_setopt($chCURLOPT_TIMEOUT1);
        
    $results curl_exec($ch);
        
    curl_close($ch);
        return 
    $results;
      } 
    I have problem with img code of pixhost..

  8.     
    #7
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    working fine for me, image is working in post

  9.     
    #8
    Member
    Website's:
    satiq.net
    If I look at the source of the post I see:

    Code: 
    &lt;a href="http://t2.pixhost.org/thumbs/111/1111_aa_aa.jpg"&gt;&lt;img src="http://t2.pixhost.org/thumbs/111/1111_aa_aa.jpg" alt="sssss" border="0"/&gt;&lt;/a&gt;

    Edit:

    Now it seems work with that function:

    PHP Code: 
    $postbody htmlspecialchars_decode($postbody); 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Xmlrpc and Cloudflare
    By skinner in forum Web Development Area
    Replies: 4
    Last Post: 30th May 2012, 09:08 AM
  2. Replies: 8
    Last Post: 3rd Dec 2011, 03:27 PM
  3. [HELP] How to install PHP-XMLRPC on CentOS?
    By ChaoscripT in forum Server Management
    Replies: 2
    Last Post: 19th Nov 2011, 07:45 PM
  4. error while using xmlrpc
    By chems in forum Wordpress
    Replies: 1
    Last Post: 31st Jul 2011, 12:34 PM
  5. Help installing php with xmlrpc.mysql,apache
    By lukip006 in forum Technical Help Desk Support
    Replies: 8
    Last Post: 20th Mar 2011, 04:34 AM

Tags for this Thread

BE SOCIAL