Current User: Guest
Please consider registering


Register? | Lost Your Password?

Search Forums:


 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

insert post function?

Information
UserPost

8:49 am
Jan 19, 2010


dustin999

Austin, TX

Member

posts 7

 
1

I'm trying to create my own post.  I looked through the API and can't seem to find what I need.  From what I can tell, the API only has template tags and pluggable functions, but what about functions like insert post, get post, etc.?

I'm going to proceed down the path of reverse engineering the code to see if I can find the function I need, but thought I'd ask the question prior to going down that route.

FYI, I'm working on migrating my current site off of bbpress into simple press.  I just find simple press so much more powerful, not to mention a better method for sharing user databases and authentication (I never liked bbpress's approach, which was more like a bridge than a true shared system).

Thanks!
-Dustin

9:02 am
Jan 19, 2010


Yellow Swordfish

Peterborough, England

SPF Master
SPF Master

posts 15150

 
2

Believe it or not I don't have any idea how bbPress does user integration. I looked at it back in 200x whatever and decided I didn't much like it and never went back.

Ok – we dp not currently expose an  API for things like this although we plan to revamp a lof of this over the coming year to utilise templating etc and this kind of function exposure would be good. But we are in the very first stage of discussion on this sort of thing.

Having said that – for inserting a new topic/post or reply post you need the code file sf-post.php which you will find in the simple-forum/library/ folder. Inspect the $newpost array.

Note this has changed for the better in the new 4.2 (currently available in beta) in terms of improved data filtering and sanitising.

Yellow Swordfish

9:10 am
Jan 19, 2010


dustin999

Austin, TX

Member

posts 7

 
3

Thanks, I just started looking at sf-post.php and it doesn't look too hard to accomplish what I want.  Basically just need to make sure $_REQUEST is loaded with the right vars and call sf-post, or at least that's my first inclination.

Is there anything special I need to do for the variable 'forum-userform_addtopic'?  Looks like it's something to prevent duplicate posts and/or exploits but not sure how it is supposed to be generated.

Thanks again,
Dustin

9:27 am
Jan 19, 2010


Yellow Swordfish

Peterborough, England

SPF Master
SPF Master

posts 15150

 
4

Good point. That's the WP form nonce. You can read up on that in the WP codex. Your best bet would be to remove that line and the check_referrer call while you are using the file outside of the entry form.

Yellow Swordfish


Reply to Topic:
insert post function?

Guest Name (Required):

Guest Email (Required):

NOTE: First Posts are subject to administrator approval before being displayed

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
2 + 6
   


Information


About the Simple:Press Forum

Forum Timezone: America/Chicago

Most Users Ever Online: 118

Currently Online: cavamondo, Alex Greenland, chris.brown
41 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 3
Forums: 10
Topics: 6343
Posts: 45436

Membership:

There are 4375 Members
There have been 1720 Guests

There are 2 Admins
There are 2 Moderators

Top Posters:

jim – 415
ovizii – 232
Tal – 206
Isaak – 183
Barandum – 178
David Polensky – 173
neon – 154
peterhol – 145

Recent New Members: beverly, ivie97, yogita, Nickinchicago, otherwhirl, CWS, Xephan, asnevitt, innerrock, guilli

Administrators: Yellow Swordfish (15150 Posts), Mr Papa (14889 Posts)

Moderators: -Radio- (1251 Posts), Luffer (482 Posts)