Recent Topics

1 Feb 27, 2007 11:49    

My b2evolution Version: 1.9.x

Hi

Over the past months, I programmed a project tracking system that isn't linked to any news system till now. Recently the request came to display a form every time a new project is being added that allows the user to enter some information about the project. These information should be integrated with the blog. So what I wanna do is to bypass the backend and write all the information right away into the DB. I already tried adding an entry into evo_posts, but that didn't change anything. What do I need to change in order to create a new entry?

Thanks for the help!

2 Mar 11, 2007 12:15

I will find how I did that and I will send you

3 Mar 11, 2007 16:07

I'll take a quick guess and say that you also need to automagically populate the evo_postcats table, but I'm also interested in what Walter comes up with for my own spin on this type of thing. Eventually I'll want a way to add a user with a blog and a category and a protected post in that category that is credited to the new blogger. Sort of like a miniature autoblog plugin, only dependent on me (as The Admin) deciding this new blogger gets his/her own blog.

Anyway I'll guess that if you're looking to add a post and adding info to the posts table isn't doing it then you need to also populate the postcats table.

4 Mar 11, 2007 16:20

Didn't I post a solution to this a while ago? Summat to do with $fred = & new Item() ?

Anyway, in case I didn't, you can create a new item, add all your bits and bobs and then tell it to slap itself into the db ;)

¥
*edit*
Yay, I found fred
¥åßßå wrote:

	$fred = & new Item();
	$fred->set( 'title', 'hello world' );
	$fred->set( 'content', 'Yet another hello world post' );
	$fred->set( 'main_cat_ID', 228 );
	$fred->dbinsert();

¥

5 Mar 13, 2007 14:23

Thx for the answers. I should have mentioned that I'm normally programming in Perl... I'm only switching to PHP if there's no other way to accomplish what I want. So I tried EdB's solution and it worked. Thx a lot!


Form is loading...