A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




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

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
insert post function?
Jan 19, 2010
8:49 am
Member
Forum Posts: 15
Member Since:
Jan 19, 2010
Offline

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

Jan 19, 2010
9:02 am

SP Master
Forum Posts: 22131
Member Since:
Nov 9, 2008
Offline

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
Jan 19, 2010
9:10 am
Member
Forum Posts: 15
Member Since:
Jan 19, 2010
Offline

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

Jan 19, 2010
9:27 am

SP Master
Forum Posts: 22131
Member Since:
Nov 9, 2008
Offline

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
Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: Mr Papa, SPQC
56 Guest(s)

Currently Browsing this Page:
1 Guest(s)

See All Online Activity

Top Posters:

-Radio-: 1251

Lee H: 606

Luffer: 535

Conrad_Farlow: 485

jim: 478

neon: 263

ovizii: 240

Tal: 240

Member Stats:

Guest Posters: 2616

Members: 7328

Moderators: 1

Admins: 2

Forum Stats:

Groups: 5

Forums: 16

Topics: 10839

Posts: 79118

Moderators: Brandon C (158)

Administrators: Yellow Swordfish (22131), Mr Papa (23580)