We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26641
    • 27 Posts
    @sylva

    Hey,

    The error isn’t that much of a concern. It is basically just looking for XML to parse and it’s not getting it because either it’s not connecting to wordpress correctly, or wordpress isn’t giving back the info.

    Did you enable XML-RPC inside your wordpress blog as per the instructions here: http://www.allebrum.com/current_projects/allebrum-wordpress-tools-for-modx

    If you did, I’ll be happy to take a look if you want to email me the login info to senica at allebrum.com


    -Senica
      • 29074
      • 3 Posts
      @senica

      hey - now it works fine!
      I think the error was because of the domain-redict. Finally I used the redirected domain (centraltheaterfreunde.de) and as path only /xmlrpc.php.
      It is crazy I’m sure I tried this combination already.
      Thank you for your help!
      Best regards, Sylva
        • 26641
        • 27 Posts
        Glad you got it to work.
          • 31283
          • 22 Posts
          This is very cool. Is there an easy way to truncate the returned post text, with a "Read More" link for the user to click?

          Thank you.

          /edit

          I tried doing this by simply modifying the WP post and adding a <!--more--> tag, but unfortunately my ModX site is only showing the excerpt text; no link to the rest of the post is available (clicking the title still simply shows the post summary).
            • 31283
            • 22 Posts
            Well, getting closer. Using this shows me the rest of the post:

            echo "<b>Text More:</b>" .$v["mt_text_more"]."<br/>";


            ...but still unsure how to show the whole post when clicking on the title link.
              • 31283
              • 22 Posts
              Solved: using a combination of the ’link’ and ’mt_excerpt’ params inside the snippet, along with a manual Excerpt in the WP blog itself.

              Forgive the narration here, but I figured it might help someone else out in the future.
                • 31283
                • 22 Posts
                New day, new question. I’m trying to sort my posts by month (creating an automated archive), but am having trouble accessing the published date.
                echo "<b>Date created:</b>" .$post["dateCreated"]."<br/>";
                echo "<b>Post ID:</b>" .$post["postid"]."<br/>";
                echo "<b>Title:</b>" .$post["title"]."<br/>";
                

                ...is returning:
                Date created:
                Post ID:
                Title:Testing Blog - Post 01


                Any thoughts? Thanks.
                  • 31283
                  • 22 Posts
                  If anyone else comes across this, you can access the date by modifying the allebrumWordpress.inc.php file:

                  if ($name == "dateCreated" || $name == "date_created_gmt") {
                       $elements["$name"] = $xpath->query("value", $e)->item(0)->nodeValue;
                  } else {
                       $elements["$name"] = $xpath->query("value/string", $e)->item(0)->nodeValue;
                  }
                    • 26641
                    • 27 Posts
                    Hey vanian,

                    I seem to have stopped getting notices when some posts here...guess I need to check into that.

                    I wanted to point something out that I ran into when I was using this module on a site the other day. I was getting an error about XPATH query not being valid so I changed this:
                    $elements["$name"] = $xpath->query("value/string", $e)->item(0)->nodeValue;
                    

                    Which is located in most every function on the class to:
                    $elements["$name"] = $xpath->query("value", $e)->item(0)->nodeValue;
                    


                    Since some XML that comes from Wordpress does not a <string> tag it was throwing an error.
                    You can also put a try{} around that line if you have a problem and want to process the xml correctly.

                    At any rate, if you just grab the value and not value/string, You should get everything in the elements string array that wordpress sends back.

                    So you could do something like:
                    $posts = $blog->getList(10);
                    foreach($posts as $k=>$v){
                      echo $k;
                    }
                    


                    That will give you a list of all the available xml tags sent back from wordpress. This would be handy if you were looking for using the date, and didn’t know what the array name was it was.

                      • 12090
                      • 19 Posts
                      I am receiving the same error as posted earlier in this thread. I verified that it has nothing to do with my domain or path to xmlrpc. I also have xmlrpc already enabled because I am using it for another remote posting solution. Does this mean that I need to create a new post for this to start parsing?

                      PHP error debug
                        Error: 	Argument 2 passed to DOMXPath::query() must be an instance of DOMNode, null given, called in /hermes/bosweb/web206/b2068/sl.hexxamillion/public_html/cms/manager/includes/document.parser.class.inc.php(770) : eval()'d code on line 69 and defined	 
                        Error type/ Nr.: 	- 4096	 
                        File: 	/hermes/bosweb/web206/b2068/sl.hexxamillion/public_html/cms/assets/snippets/allebrumWordpress/allebrumWordpress.inc.php	 
                        Line: 	47	 
                        Line 47 source: 	$this->blogId = $xpath->query("member[name='blogid']/value/string", $q)->item(0)->nodeValue;