We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    This is an auto-generated topic for <a href="http://modxcms.com/extras/package/646">Wordpress Tools 0.3-release</a> by senica.

    Brief Description:
    This is a collection of snippets that interacts with a single class file included in this download. It makes calls via XML-RPC to a Wordpress blog and pulls that information back.



    Some of the available functions are:



    Get a list of all your blogs from Wordpress.


    Get a list of all categories within a blog.


    Get a list of all the titles of posts within a blog.


    Build a navigation based on categories and posts.


    Get a single post.


    Get all or just a few of your posts.


    Get all the tags used on your Wordpress blog.


    Get just the tags of a particular post.


    Allow users to post comments to your Wordpress blog remotely.


    Get a list of all or just a few comments from a particular post.



    This release includes an extra variable that needs to be filled out, $path. This allows you to integrate with wordpress blogs that are self-hosted as well as on wordpress.com
      • 26641
      • 27 Posts
        • 3504
        • 11 Posts
        « MODx Parse Error »
        MODx encountered the following error while attempting to parse the requested resource:
        « PHP Parse Error »

        PHP error debug
        Error: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known
        Error type/ Nr.: Warning - 2
        File: allebrumWordpress.inc
        Line: 383
        Line 383 source: $fp = fsockopen($this->blog,80);


        what could be the problem?
          • 26641
          • 27 Posts
          When you write this line in your snippet:
          $awp = new AWP($domain, $username, $password, $path);

          is $domain a valid domain name?

          if you have $domain = "something.com";
          and that is not working, then try, $domain = "http://www.something.com";

          Here another forum that talks about that problem. http://bytes.com/topic/php/answers/166978-problem-fsockopen

          Also, the AWP class assumes that your website is on port 80. If this is not the case and you need a special port number, shoot me an email: senica at allebrum.com

          You can also try substituting the domain name with the actual ip address to rule out dns problems.
            • 29676
            • 45 Posts
            I have followed the instructions for the most basic set up but no posts show up in the modx page .. any tips and help appreciated

            Thanks

            Steve
              • 26641
              • 27 Posts
              @Steve: Not really sure how to help with no more information. Shoot me an email and I’ll be happy to take a look. senica at allebrum.com
                • 29676
                • 45 Posts
                Thanks, I have emailed you direct and will post the solution here if required.
                  • 29074
                  • 3 Posts
                  Dear all,
                  I think, I’ve got the same problem to get the snippet running:

                  These are my Blog Variables. I tried Domain with and without ’http’:

                  $domain		= "centraltheaterfreunde.de";	
                  $username	= "admin";			
                  $password	= "**********";		
                  $path		= "momo-leipzig.de/freundeblog/xmlrpc.php";
                  


                  Domain centraltheaterfreunde.de pointed on momo-leipzig.de/freundeblog directly. I already tried to use this path.

                  That is the error message I’ve got:
                  MODx encountered the following error while attempting to parse the requested resource:
                  « PHP Parse Error »
                   
                  PHP error debug
                    Error:	DOMDocument::loadXML() [domdocument.loadxml]: Empty string supplied as input	 
                    Error type/ Nr.:	Warning - 2	 
                    File:	/var/www/web193/html/cms/assets/snippets/allebrumWordpress/allebrumWordpress.inc.php	 
                    Line:	43	 
                    Line 43 source:	 $xml->loadXML($data);


                  Maybe you’ ve got an idea what I am doing wrong.
                  Many many thanks,
                  Sylva
                    • 26641
                    • 27 Posts
                    @sylva
                    Good Morning!...in my case anyways smiley

                    The setup should look like this:
                    $domain		= "momo-leipzig.de";	
                    $username	= "admin";			
                    $password	= "**********";		
                    $path		= "/freundeblog/xmlrpc.php";
                    


                    If you were to put $domain and $path together so it looked like this: http://momo-leipzig.de/freundeblog/xmlrpc.php you should actually be able to get to a page.

                    Try that out.

                    FYI, one of the problems above had to do with php not being configured with DOM.

                    Let me know if that works!
                      • 29074
                      • 3 Posts
                      Hi,

                      Sorry, It doesn’t work but the error message changed:
                      MODx encountered the following error while attempting to parse the requested resource:
                      « PHP Parse Error »
                       
                      PHP error debug
                        Error:	Argument 2 passed to DOMXPath::query() must be an instance of DOMNode, null given, called in /var/www/web193/html/cms/manager/includes/document.parser.class.inc.php(770) : eval()'d code on line 23 and defined	 
                        Error type/ Nr.:	 - 4096	 
                        File:	/var/www/web193/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;


                      Can I check the DOM/php configuration in phpinfo()? There I found this:

                      dom

                      DOM/XML enabled
                      DOM/XML API Version 20031129
                      libxml Version 2.6.32
                      HTML Support enabled
                      XPath Support enabled
                      XPointer Support enabled
                      Schema Support enabled
                      RelaxNG Support enabled

                      Thank you very much for helping me - the snippet is exactly what I need for my website ...
                      Sylva