ishiboo
03-16-2010, 03:54 PM
I need to programmatically post to a thread. I examined the tables and real threads and came up with a solution, however it does not keep the thread "in sync"... there are times where members cannot browse to the latest page.
Is there a guide for doing this? I know there are some 3rd party addons but I'd prefer to be able to do it myself in code. Here is what I'm running:
INSERT INTO vbulletin.post SET threadid = THREADID, parentid = POSTID, username = 'Username', userid = USERID, title = '', dateline = unix_timestamp(now()), pagetext = 'test', ipaddress = '127.0.0.1', visible = 1
UPDATE thread SET lastpostid = NEWPOSTID, lastposter = 'Username, dateline = UNIX_TIMESTAMP(NOW()) WHERE threadid = THREADID LIMIT 1
THREADID is the id of the thread I'm posting to. POSTID is the ID of the first post. USERID is the user ID of the member. Everything works except the thread paging/timeline issue I mentioned. NEWPOSTID is the id of the post which was just inserted.
Is there a guide for doing this? I know there are some 3rd party addons but I'd prefer to be able to do it myself in code. Here is what I'm running:
INSERT INTO vbulletin.post SET threadid = THREADID, parentid = POSTID, username = 'Username', userid = USERID, title = '', dateline = unix_timestamp(now()), pagetext = 'test', ipaddress = '127.0.0.1', visible = 1
UPDATE thread SET lastpostid = NEWPOSTID, lastposter = 'Username, dateline = UNIX_TIMESTAMP(NOW()) WHERE threadid = THREADID LIMIT 1
THREADID is the id of the thread I'm posting to. POSTID is the ID of the first post. USERID is the user ID of the member. Everything works except the thread paging/timeline issue I mentioned. NEWPOSTID is the id of the post which was just inserted.