vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   PHP code to create new thread in existing forum (https://vborg.vbsupport.ru/showthread.php?t=321861)

jpr 02-17-2016 12:41 PM

PHP code to create new thread in existing forum
 
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

Quote:

Originally Posted by jpr (Post 2565104)
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?


All times are GMT. The time now is 09:27 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01023 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete