Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-01 15:45:16

kielby
New Member
Registered: 2006-02-28
Posts: 4

Create new articles in plugin

Hi everyone.
Not sure if this belongs in this forum or in the plugin one. But here goes.

I’m writing a plugin which will create new articles and add them to textpattern. I haven’t been able to find any API that textpattern provides to plugins for this purpose. Is this correct?

Assuming there is no API, what are my options? I will probably insert directly into the database, though I’m worried that this wouldn’t be very future proof in case the database schema changes. I’m sure that probably doesn’t happen too often and from what I’ve seen it won’t be hard to do / maintain.

Thanks,
Andrew

Offline

#2 2006-03-02 17:10:13

KurtRaschke
Plugin Author
Registered: 2004-05-16
Posts: 275

Re: Create new articles in plugin

I doubt that the database schema for the textpattern table will be changing much, so you should probably be safe to just insert the values directly.

Alternatively, see if you can get the development team to release TXP_Wrapper publicly (should happen with the XML-RPC release, anyway). TXP_Wrapper would probably solve your problem nicely; it has methods for creating and modifying articles which should be reasonably future-proof.

-Kurt


kurt@kurtraschke.com

Offline

#3 2006-03-02 17:41:38

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Create new articles in plugin

Well, it’d be future proof in that there’d be nothing to differentiate your inserted articles from the “normal” ones, so they’d be updated if the table structure was altered. You’d only need to worry about keeping your plugin insertion up to date.

Offline

Board footer

Powered by FluxBB