We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26641
    • 27 Posts
    I don’t believe it modifies it at all. I believe everything is basically just a dump of what wordpress sends in the xml. Which means it maybe be getting wrapped in one of the lovely <mce> tags or something from wordpress.

    do you have an example that I can see?

    after the page renders, look at the html code to see what the page is rendering?

    I do recall something about some calls giving different information in terms of the html formatting. Like one call gives the regular image tag, and another call will give a shortcode style tag. This has to do with the calls being made. Some calls are native wordpress calls to xmlrpc. Others are metablog calls and some...something else.

    That being said, again, I don’t believe I changed anything in terms of formatting, what you get is what wordpress is giving ya.
      • 26641
      • 27 Posts
      Right! which thinking about it. Would make sense why you are not getting images. Because the html dump to your browser, the nggallery tag doesn’t mean a whole heck of a lot.

      If you had just put images in your post, then they should show up.
        • 3141
        • 10 Posts
        Quote from: vanian at Jun 05, 2010, 03:25 PM

        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;
        }


        Hey Vanian,

        I’ve also been struggling to include the date in my posts. I’d like it to sit under the post title. Any idea how i’d do this? I guess use your bit of code in the php file, and then call it with an echo? I’m a bit of a novice, so any help would be greatly appreciated.

        Many thanks,
        Ben
          • 26641
          • 27 Posts
          Hey ben,

          What happens when you try to include the date. If you look here: http://www.allebrum.com/current_projects/wordpress-tools#getPost
          There are two date options. I think if you use date_created_gmt from the array it should work.

          So if your code might look like this:
          $blog = new AWP($domain, $user, $pass, $path);
          
          $id = $_GET["postid"];
          
          $post = $blog->getPost($id);
          
          echo "<h2>".$post["title"]."</h2>";
          
          echo $post["date_created_gmt"];
          



          Now that I’m thinking about it, there may have been a node in the xml that changed that causes this not to work.

          If this doesn’t help, shoot me an email. senica at allebrum.com I’ll see if I can help.
            • 26641
            • 27 Posts
            FIX for unreported array functions.

            A node changed on the Wordpress XML, so some array elements such as ’dateCreated’ does not work as Ben posted above.

            To fix this follow these steps:
            If you open up the allebrumWordpress.inc.php  file you should see code like this:
            
            function getPost($id){
            		$request = '
            			<value><string>'.$id.'</string></value>
            			<value><string>'.$this->user.'</string></value>
            			<value><string>'.$this->pass.'</string></value>
            		';
            		
            		$xml = new DOMDocument();
            		$data = $this->query('metaWeblog.getPost', $request);
            		$xml->loadXML($data);
            		$xpath = new DomXPath($xml);
            		
            		foreach($xml->getElementsByTagName('member') as $child){
            			$name = $xpath->query("name",$child)->item(0)->nodeValue;
            			$elements["$name"] = $xpath->query("value/string", $child)->item(0)->nodeValue;
            		}
            		return $elements;
            	}
            
            It starts around line 154.  Add an echo after this line: $data = $this->query('metaWeblog.getPost', $request);
            so it looks like this:
            
            $data = $this->query('metaWeblog.getPost', $request);
            echo $data;
            
            Save that and go open a webbrowser and go to the page that you are calling getPost() from.  You should see a bunch of XML.
            
            Depending on your web browser you may have to right-click and click on view source.  But you should be able to see all the XML nodes.
            
            
            This line in the allebrumWordpress.inc.php file is what reads all the nodes into an array: $elements["$name"] = $xpath->query("value/string", $child)->item(0)->nodeValue;
            
            You will notice that it is looking for value/string nodes.
            
            Well, what I believe happened is that datetime is not a <string> node.  I haven't actually looked at this myself, but if you find a common node among all elements, just back the xpath back.
            
            Example:  If the XML file looks like this:
            
            <post>
              <value><string>date</string></value>
              <value><time>time</time></value>
            </post>
            
            Then value is the common node among all of them.
            
            So you would just need to change this line:
            $elements["$name"] = $xpath->query("value/string", $child)->item(0)->nodeValue;
            to look like this:
            $elements["$name"] = $xpath->query("value", $child)->item(0)->nodeValue;
            
            And that should allow you to pull the ["datetime"] value.
            


            Ben reported that he had to make the change throughout the whole php file and it worked for him.
              • 3141
              • 10 Posts
              Hi again,

              I’ve got the date working great (see the above post), but I’m now struggling to format it.
              It currently calls the dateCreated from Wordpress like this: 20100730T16:45:08 which I believe is in the format’iso8601’.
              I have tried adjusting the date settings in Wordpress, but this doesn’t seem to translate to modx.
              I’m assuming that I need to alter something in ’allebrumWordpress.inc.php’.

              Has anyone got any ideas?

              Many thanks,

              Ben
                • 12321
                • 12 Posts
                I am trying to use this on a local installation and keep getting errors. If I set the domain to "http://localhost" I get this:

                PHP error debug
                Error: fsockopen() [function.fsockopen]: unable to connect to http://localhost:80 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?)
                Error type/ Nr.: Warning - 2
                File: C:\wamp\www\solwalters\assets\snippets\allebrumWordpress\allebrumWordpress.inc.php
                Line: 383
                Line 383 source: $fp = fsockopen($this->blog,80);

                If I set the domain as "localhost" I get this:

                PHP error debug
                Error: DOMDocument::loadXML() [domdocument.loadxml]: Space required after the Public Identifier in Entity, line: 1
                Error type/ Nr.: Warning - 2
                File: C:\wamp\www\solwalters\assets\snippets\allebrumWordpress\allebrumWordpress.inc.php
                Line: 43
                Line 43 source: $xml->loadXML($data);

                Any direction with this would be appreciated.



                  • 32052
                  • 38 Posts
                  Hello,

                  I’m trying to make the allebrumWordpress solution on my site. I’ve successfully installed the inc.php file
                  my awpNav contains the following data

                  Wordpress was installed in this directory http://domainname.com/newsletter/
                  My configuration for the plugin was:

                  domain name = "domainname.com"
                  user name = "admin"
                  pass = "******"
                  path = "/newsletter/xmlrpc.php"
                  
                  


                  The XMLRPC in wordpress was already enabled and the DOM was also enabled at phpinfo()
                  DOM/XML	enabled
                  DOM/XML API Version	20020815
                  libxml Version	20616
                  HTML Support	enabled
                  XPath Support	enabled
                  XPointer Support	enabled
                  


                  My problem was when I put [!awpNav!] in 1 of my pages and run that page, all I can see
                  is blank page. I tried to play around with the xmlrpc.php paths but nothing seems to
                  work for me. Can anyone help me if they new the solution?

                  Thank you very mucn in advance!


                    • 26641
                    • 27 Posts
                    A blank page is most always indicative of a php error. Can you turn on error reporting and post the php error or check your logs?
                      • 32052
                      • 38 Posts
                      Quote from: senica at Oct 11, 2010, 03:45 PM

                      A blank page is most always indicative of a php error. Can you turn on error reporting and post the php error or check your logs?

                      Hi,

                      How and where can I do this?

                      Thanks!