[Function] Insert Post

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
User avatar
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

[Function] Insert Post

Post by netclectic » Sun Oct 06, 2002 7:23 pm

20031014 - updated to 1.0.7 - Download
  • add error_die_function parameter
  • add html, bbcode_on, smilies_on parameters
  • fix bugs with special chars
  • remove check for version specific field names
  • added current_time parmeter as suggested by wineknow
  • fixed small problem with ' being change to ''
  • fixed small bug in insert_post as point out by Pda0

Description:
  • This functions is used to insert a post into your phpbb forums. It handles all the related bits like updating post counts, indexing search words, etc. The post is inserted for a specific user, so you will have to already have a user setup which you want to use with it.
Features:
  • reply to an existing topic
  • specify topic type - normal (default), sticky, anouncement
  • backwards compatible with some earlier phpbb versions (2.0.0 - 2.0.4)
  • returns an array containing both the post_id and the topic_id

In the zip file you will find 2 files:
  • functions_insert_post.php - in subdir mods/netclectuc - this is where the insert_post function lives, i've put in a seperate file like this to make it easier to update with a view to adding support for attachments shortly.
  • test_insert_post.php - in here you will find some examples of how to use the function. It shows the bare necessities (i can feel a song coming on) of how to set it up for use outside of phpbb. The examples show posting a new topic, a new sticky topic, a new announcement and a reply to a topic.

(de-stickified by AbelaJohnB)
Last edited by netclectic on Tue Oct 14, 2003 11:09 pm, edited 18 times in total.
Defend the game:
Image

whofarted
Registered User
Posts: 387
Joined: Tue Apr 09, 2002 8:19 am
Location: Lost, If found return to St.Louis, MO

Post by whofarted » Mon Oct 07, 2002 12:37 am

Friggin sweet! thanks :idea:
you smell something? :)

Drummer4Life05
Registered User
Posts: 545
Joined: Sun Jul 28, 2002 1:52 am
Location: \\phpbb\forum
Contact:

Post by Drummer4Life05 » Mon Oct 07, 2002 12:52 am

Great idea man! :D

User avatar
~/.Hello
Registered User
Posts: 488
Joined: Mon Jul 22, 2002 3:50 pm
Location: Somewhere in the US...
Contact:

Post by ~/.Hello » Mon Oct 07, 2002 1:15 am

That is a sweet idea, somewhat pointless as you said but cool :)

User avatar
gatty
Registered User
Posts: 506
Joined: Fri May 03, 2002 12:27 am
Location: Australia
Contact:

Post by gatty » Mon Oct 07, 2002 10:48 am

thanks mate...works great!

nice idea :D
Gatty
www.gatty.net
Free Hosting With PHP/MySQL Support!

Image Search Before Asking!

User avatar
stevie
Registered User
Posts: 107
Joined: Wed Nov 14, 2001 4:22 am
Location: Boston area

Post by stevie » Thu Nov 14, 2002 2:22 am

This is a really cool thing!

Does it update all the various stuff that wants to be updated, like the word search indexes etc.?

In other words, if I use it to add a post, is there any difference from a post that has been added the regular way?

Thanks. -Steve

User avatar
DivScript
Registered User
Posts: 62
Joined: Tue Oct 22, 2002 8:10 pm
Location: United Kingdom
Contact:

Post by DivScript » Thu Nov 14, 2002 2:45 am

I don't quite get what it's supposed to be for.
Can someone explain please?

Thanks, - Dave.

User avatar
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic » Thu Nov 14, 2002 8:37 am

It's a function which can be used to insert a post into your forums and that's about it really, it does exactly what it says on the tin :?
Defend the game:
Image

AbelaJohnB
Former Team Member
Posts: 5674
Joined: Fri Jul 06, 2001 11:56 pm

Post by AbelaJohnB » Fri Jan 17, 2003 12:47 am

netclectic,

Would you mind writing up a bit more doc's on this?

Perhaps 'usages' and stuff like that. If so, than I'll get it into our new 'Docs' section for the MOD section of phpBB!

BBCode is allowed.


Also, I feel this is more the type of thing that belongs in the "MOD Authors" Section, so I'm gonna move it in there <smile>

User avatar
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic » Fri Jan 17, 2003 10:46 am

No problem, i'll see what i can do...
Defend the game:
Image

ionsurge
Registered User
Posts: 876
Joined: Thu Oct 10, 2002 9:24 am
Location: United Kingdom
Contact:

Post by ionsurge » Fri Jan 17, 2003 10:51 am

I dont get it what does it do exactly?

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix » Fri Jan 17, 2003 7:12 pm

ionsurge wrote: I dont get it what does it do exactly?



:arrow:
netclectic wrote: It's a function which can be used to insert a post into your forums


:wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

TechMeister
Registered User
Posts: 7
Joined: Thu Jan 16, 2003 7:58 pm
Location: Norway!

Post by TechMeister » Fri Jan 17, 2003 7:20 pm

A 'How to use' text would be nice ;)

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix » Fri Jan 17, 2003 8:12 pm

check what AbelaJohnB have asked to netclectic :wink:

edit :
but a quick example could be :

Code: Select all

$message='This is a test';
$subject = 'Test';
$forum_id = 1; // must be the id if a frum which exist
$user_id = 2; // user_id of the poster
$user_name = 'Morpheus';
$user_attach_sig = 1; // 1 active the sig , 0 not active 

function insert_post($message, $subject, $forum_id, $user_id, $user_name, $user_attach_sig)
Last edited by morpheus2matrix on Fri Jan 17, 2003 8:18 pm, edited 1 time in total.
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

TechMeister
Registered User
Posts: 7
Joined: Thu Jan 16, 2003 7:58 pm
Location: Norway!

Post by TechMeister » Fri Jan 17, 2003 8:17 pm

And where could this be put?
Last edited by TechMeister on Fri Jan 17, 2003 8:18 pm, edited 1 time in total.

Post Reply

Return to “[2.0.x] MOD Writers Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests

cron