Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 1st Apr 2009, 02:28 PM   #1
Advanced Warrior
War Room Member
 
Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
Default
question about wordpress
Share on: 
fb share twitter share gplus share more share

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?
Johnathan is offline  
Unread 1st Apr 2009, 03:08 PM   #2
VIP Warrior
War Room Member
 
ereadergold's Avatar
 
Join Date: 2008
Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

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
ereadergold is offline  
Unread 1st Apr 2009, 03:10 PM   #3
Advanced Warrior
War Room Member
 
Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

Originally Posted by mywebwork View Post

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
Hi Bill,

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?
Johnathan is offline  
Unread 1st Apr 2009, 05:39 PM   #4
VIP Warrior
War Room Member
 
ereadergold's Avatar
 
Join Date: 2008
Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

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
ereadergold is offline  
Unread 1st Apr 2009, 05:43 PM   #5
VIP Warrior
War Room Member
 
ereadergold's Avatar
 
Join Date: 2008
Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

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
ereadergold is offline  
Unread 1st Apr 2009, 10:24 PM   #6
Advanced Warrior
War Room Member
 
Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

Originally Posted by mywebwork View Post

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
Thanks -- I checked that out, didn't seem to work
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
Johnathan is offline  
Unread 1st Apr 2009, 11:34 PM   #7
Warrior Member
 
kengary's Avatar
 
Join Date: 2009
Location: Castle Rock, Co
Posts: 20
Thanks: 0
Thanked 4 Times in 3 Posts
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

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
kengary is offline  
Unread 2nd Apr 2009, 07:45 AM   #8
Advanced Warrior
War Room Member
 
Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

Originally Posted by kengary View Post

In this statement you gave:

('metaWeblog.newPost','','user','password' ,$ content,false))

There is a space between the $ and content and there shouldn't be. It should be not $ content. See what I mean?

Would that have anything to do with it?
Thanks, no, no, that's not it.

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...
Johnathan is offline  
Unread 2nd Apr 2009, 02:18 PM   #9
New Warrior Member
 
Join Date: 2007
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

The date needs to be in ISO8601 format. Have you tried putting the date and time in this format?

e.g.

20090402T11:25:00
rapidprog is offline  
Unread 2nd Apr 2009, 02:55 PM   #10
Advanced Warrior
War Room Member
 
Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

Originally Posted by rapidprog View 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
Yes, I've tried doing that, but it doesn't seem to work...
Johnathan is offline  
Unread 2nd Apr 2009, 07:44 PM   #11
New Warrior Member
War Room Member
 
Lisa Copen's Avatar
 
Join Date: 2007
Location: Yelm, WA, USA.
Posts: 25
Thanks: 13
Thanked 3 Times in 3 Posts
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

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

Lisa M. Copen
Lisa Copen Recommends - Internet Marketing Resources Blog
IM Squidoo Lens
Lisa Copen is offline  
Unread 2nd Apr 2009, 10:16 PM   #12
Advanced Warrior
War Room Member
 
Join Date: 2008
Posts: 811
Thanks: 247
Thanked 69 Times in 59 Posts
Default
Re: question about wordpress
Share on: 
fb share twitter share gplus share more share

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?
Johnathan is offline  
Closed Thread


Bookmarks

Tags
question, wordpress


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 10:46 AM.