Php script to insert a post with images

Php script to insert a post with images

Postby laf1greg on Fri Jul 08, 2011 9:57 am


I would like to insert a post with one or more images in a blog with a php script (the script will be the same folder as lifetype code and will use the lifetype classes) , maybe someone did it before and provide me the code ?

I saw that there is a plugin that can do it over HTTP (atom) but a lighter solution would be better.

Thanks for your help

Posts: 1
Joined: Fri Jul 08, 2011 9:49 am
LifeType Version: 1.12.1

Re: Php script to insert a post with images

Postby jondaley on Fri Sep 02, 2011 11:37 am

You might take a look at the end of the wizard.php code, where a blog, category and "welcome" post are created when the blog is first installed.

It doesn't add an image, but you will see how the flow goes.

You could either add it to the class/gallery/dao/* code, or else, I would probably just FTP the image to a known directory and link to the image in the blog article, and skip adding it to the gallery, unless you needed it in the gallery for later use, or cared what the URI to the image looked like, etc.
Lifetype Expert
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Return to Requests and Suggestions