PDA

View Full Version : PHP code to create new thread in existing forum


jpr
02-17-2016, 12:41 PM
Hello,

We have a custom PHP script that was written for vBulletin 4 that I wrote within the vBulletin installation directory. It accepts a POST request and uses the Thread_FirstPost and AttachmentFiledata data managers to create a new thread in an existing forum. We have recently upgraded to vBulletin 5. Does anyone know how to code PHP, using the vBulletin 5 API to create a new thread with attachments. I can't seem to find anything and the support team was of absolutely no help whatsoever. They just pointed me to the severely lacking API documentation without any direction as to which classes I should be looking at. Any help would be greatly appreciated.

I could not find a thread that had already answered this question so I apologize is this is a duplicate, but if it is, please direct me to the thread that has already answered this question (if it exists). Thank you!

Replicant
02-17-2016, 01:39 PM
You will find the classes you are looking for in includes/vb5/frontend/controller/createcontent.php. Be prepared, this is a busy script. I've called it from the command line with curl and successfully created threads posts and comments. I have never tried adding attachments or photos, butt this is where it is all done. CKEditor submits multi-part binary formdata to accomplish attachment uploads. Hope this helps.

jpr
02-18-2016, 12:16 PM
@Replicant. It definitely gives me a place to start. I appreciate the help. Thank you.

EXCEHype5SG
01-20-2017, 02:35 AM
Hello,

We have a custom PHP script that was written for vBulletin 4 that I wrote within the vBulletin installation directory. It accepts a POST request and uses the Thread_FirstPost and AttachmentFiledata data managers to create a new thread in an existing forum. We have recently upgraded to vBulletin 5. Does anyone know how to code PHP, using the vBulletin 5 API to create a new thread with attachments. I can't seem to find anything and the support team was of absolutely no help whatsoever. They just pointed me to the severely lacking API documentation without any direction as to which classes I should be looking at. Any help would be greatly appreciated.

I could not find a thread that had already answered this question so I apologize is this is a duplicate, but if it is, please direct me to the thread that has already answered this question (if it exists). Thank you!

would you mind sharing your PHP code for the vbulletin 4?