| | #1 |
| Advanced Warrior War Room Member Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
|
Hi, I don't know if anyone knows anything about programming, or can redirect to to a place where someone might be able to offer a suggestion... But I am trying to create a custom wordpress plugin (PHP), and using the XMLRPC -- calling the wordpress post. However, I can't seem to figure out what type of data the "dateCreated" should contain. I keep getting a malformed data error. Does anyone have any idea? I.e., $content['dateCreated'] = .........? $client->query('metaWeblog.newPost','','user','password' ,$ content,false)) I can't seem to figure out what type of data the data should be. Just sticking something like "08-08-2008" doesn't seem to work. Any ideas? |
| |
| | #2 |
| VIP Warrior War Room Member Join Date: 2008 Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1 |
Hi Jonathan It's just a guess but it may be looking for a properly formatted SQL date, or maybe an SQL timestamp. The SQL date format for today would be "2009-04-01". The SQL timestamp format for today at noon would be "2009-04-01 12:00:00". Again, it's just a guess! Bill |
| |
| | #3 | |
| Advanced Warrior War Room Member Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
|
Thanks -- I tried the SQL timestamp, but that didn't work And the frustrating thing is, I can't seem to find any 'good' wordpress documentation (a lot of it is gobblelegook)... Any other ideas? Or perhaps ideas on where I can find out?
| |
| |
| | #4 |
| VIP Warrior War Room Member Join Date: 2008 Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1 |
I can sympathize - I've always planned to write a plugin for WordPress one day and ironically I now find myself spending today writing my first component for Joomla instead! If the WP documentation is anything as sparse as the Joomla stuff is then I can really feel your pain! I assume you've already poured through the documentation on the WordPress site? This looked like a good point to start - Writing a Plugin WordPress Codex - I'm sure you've already been through that. This one also looked useful: Function Reference/wpdb Class WordPress Codex - again I'm probably not telling you anything you don't already know. I'll be following this thread to see if anyone else has good resources for writing WP Plugins, as I said I do plan to do that one day. Best of luck Bill |
| |
| | #5 |
| VIP Warrior War Room Member Join Date: 2008 Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1 |
One other note Johnathan: This looks like it may be useful - Rad Geek’s Projects How to deal with dates and timestamps in WordPress Bill |
| |
| | #6 | |
| Advanced Warrior War Room Member Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
|
![]() Yes, the wordpress documentation is really screwed up (I'm amazed anyone has managed to create a plugin in the first place! )... From what I can gather, it 'seems' as if I need to create some kind of "date" object, but I'm not sure how to do that...(It seems I can't simply pass a string, but I actually need to have some kind of date object... Do you know of any such objects?) Thanks! Johnathan | |
| |
| | #7 |
| Warrior Member Join Date: 2009 Location: Castle Rock, Co
Posts: 20
Thanks: 0
Thanked 4 Times in 3 Posts
|
In this statement you gave: $client->query('metaWeblog.newPost','','user','password' ,$ content,false)) There is a space between the $ and content and there shouldn't be. It should be $content not $ content. See what I mean? Would that have anything to do with it? |
|
Ken Gary Kencinnus.com - Amazing Internet Marketing Plugins for aMember :: amSalesFunnel :: amUpsell :: amOffers :: amStrategy :: amThankYou :: amProtect :: amPhysical for Disk.com :: aMail for AWeber, AutoResponse Plus and MailChimp | |
| |
| | #8 | |
| Advanced Warrior War Room Member Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
|
It seems that some kind of 'date' object is required to be sent (I am assuming that, because it seems that I have to "guess" how to program in wordpress ) Spent about 2-3 hours "guessing" what different formats it would want it in, because there doesn't seem to be any dox, etc...Closest I could come up with is 'datetime', but that is php 5.2.0, so am not sure what other alternatives... trying to work within the wordpress 'sandbox', but seems like I just have to simply manually edit it via sql... | |
| |
| | #9 |
| New Warrior Member Join Date: 2007 Location: , , USA.
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
|
The date needs to be in ISO8601 format. Have you tried putting the date and time in this format? e.g. 20090402T11:25:00 |
| |
| | #10 |
| Advanced Warrior War Room Member Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
| |
| |
| | #11 |
| New Warrior Member War Room Member Join Date: 2007 Location: Yelm, WA, USA.
Posts: 25
Thanks: 13
Thanked 3 Times in 3 Posts
|
Found this on a WordPress User Group site: $post_date = mysql2date("Ymd\TH:i:s", $postdata['Date']); "dateCreated" => new xmlrpcval($post_date,"dateTime.iso8601"); I included the first line so you would see the formatting they applied to $post_date. The second line looks like the code to create a date object. Let us know if it works. Lisa |
| | |
| |
| | #12 |
| Advanced Warrior War Room Member Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
|
Thanks, tried it, doesn't work Seems I need to install some kind of library/server to support the 'xmlrpcval' class, and I don't think I have the required priveleges on my server (plus when I have tried installing 3rd party libraries, seems to screw somethnig else up )thanks for the suggestion...! Any other ideas? |
| |
|
| Bookmarks |
| Tags |
| question, wordpress |
| |