Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-11-08 21:05:19

zeeforel
Member
From: Nieuwerkerk a/d IJssel, NL
Registered: 2004-10-16
Posts: 92
Website

Using php to create a post from an external application?

Hi,

Maybe a strange question, but I would appreciate it very much if someone around here could show me the basics of how to get TxP to create a new post (article) via an external php application.

Many thanks in advance.

Best regards,

Marcel

Offline

#2 2007-11-08 21:17:21

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Using php to create a post from an external application?

Just insert a new row in the textpattern MySQL table with all the fields filled out correctly.

Offline

#3 2007-11-09 05:53:29

zeeforel
Member
From: Nieuwerkerk a/d IJssel, NL
Registered: 2004-10-16
Posts: 92
Website

Re: Using php to create a post from an external application?

Hi Ruud,

Is that all it will take to publish a new article? I thought that I needed to get deep into that XML-RPC stuff….

Thanks.

Best regards,

Marcel

Offline

#4 2007-11-09 07:53:48

zeeforel
Member
From: Nieuwerkerk a/d IJssel, NL
Registered: 2004-10-16
Posts: 92
Website

Re: Using php to create a post from an external application?

Hi Ruud,

I looked in the Textpattern table and I guess the only issue is that field UID (?) which seems encripted somehow? Would you know how to generate that?

Thanks in advance.

Offline

#5 2007-11-09 10:16:18

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Using php to create a post from an external application?

UID is a random md5 checksum. As long as it’s unique, it’s okay.

Offline

#6 2007-11-09 10:22:09

zeeforel
Member
From: Nieuwerkerk a/d IJssel, NL
Registered: 2004-10-16
Posts: 92
Website

Re: Using php to create a post from an external application?

Hi Ruud,

Thanks for pointing that out.

I am very open to a braindump on the php code to create such a md5 string by the way :-)

Offline

#7 2007-11-09 10:26:08

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Using php to create a post from an external application?

TXP itself uses: $uid = md5(uniqid(rand(),true));

Offline

#8 2007-11-09 10:27:16

zeeforel
Member
From: Nieuwerkerk a/d IJssel, NL
Registered: 2004-10-16
Posts: 92
Website

Re: Using php to create a post from an external application?

Ruud,

Very much appreciated!!!

Thanks.

Offline

#9 2007-12-13 23:19:41

reast
New Member
Registered: 2007-12-11
Posts: 4

Re: Using php to create a post from an external application?

How is ‘Body_html’ generated? Looks like it’s created client side?

Offline

#10 2007-12-14 09:54:12

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Using php to create a post from an external application?

body_html is derived from body. In some cases they are the same, but body can also have textile markup which is converted to HTML for body_html.

Offline

Board footer

Powered by FluxBB