The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello,
Does anyone on this board have experience with programmatically adding threads (and ofcourse their first post) in vBulletin's forum via a .NET application? I have looked at the API's (in PHP) which vBulletin made available and it seems that I would need: "class_dm_threadpost.php", if I would be programming in PHP. The problem now is that I need to insert threads via a .NET application I'm developing. I've scrolled through this API and it's 36 pages long, which indicates to me that inserting a thread is not as easy as it would seem. Namely inserting a record in the 'thread' table and a record in the 'post' table and voila. Or is it this simple? Is there anyone that can point me into the right direction? Thank you very much in advance for answering. |
#2
|
||||
|
||||
![]()
It is mainly SQL queries, to add the thread, the post, and update some caches. It is not as "simple" as some people think.
What I suggest is maybe creating your own PHP file that when called upon, creates a thread. This would allow you to use vBulletin classes/methods, and thus, reducing the chance of things breaking in the future. |
#3
|
|||
|
|||
![]()
First off, thank you very much for replying so soon.
I am a complete PHP novice, so in order to fully understand what you mean, can I ask some more questions? 1) What do you exactly mean with making my own PHP file? I'm sure with some time I could create some PHP script (with some help from you *looks hopefull* ![]() 2) I'm afraid I'll have to do it the hard way. I'll have to add a thread + post + update some caches manually from .NET code. If I go that way, could you help me a bit? For example... What are those caches you are talking about? And which ones need an update? By the way... Just to make my intentions absolutely clear. My .NET app's soul purpose is to just shoot a thread (+ post) into vBulletin's MySQL DB. After that, the app is basically done. It doens't need to know anything about it, or manage it further. Would perhaps make the process a bit simpler? ![]() Thnx in advance for your help! |
#4
|
|||
|
|||
![]()
I'm not sure able .NET, but I posted a PHP class a couple of days ago to make threads, posts, and send PMs. It has all the proper SQL queries in it. Here is the link to the thread.
|
#5
|
|||
|
|||
![]()
Thank you very much GameDude. I've scanned the code and I certainly think it'll help me construct .NET code which will do the same as your PHP class. Just two quick questions though:
1) vBulletin's DB doesn't auto increment the technical ID's (I see you adding 1 to the id's in the code)? 2) You don't need the column 'DateLine' (you insert post and thread without dateline)? Thnx again for the code and thnx in advance for answering. |
#6
|
||||
|
||||
![]() Quote:
The dateline must be generated and inserted, it is not automatically inserted by MySQL. |
#7
|
|||
|
|||
![]()
@Dismounted:
1) Yeah, I figured that would be a bit strange. But have you seen Gamedude's code? He claims it works. If this is true, his code could never work. 2) Ok, how does one generate a Dateline then? What is it exactly? It looks a bit like an UNIX timestamp. 3) Last question, could you please take a quick peek at Gamedude's code and tell me if that code works? 'Cause then I'm going to stop immediatly converting his PHP code to .NET code. Thank you in advance. |
#8
|
||||
|
||||
![]() Quote:
Quote:
The code probably works, but is it the best method? Probably not. See the function "build_new_post()", it contains what you want - the "method" of generating a post/thread. |
#9
|
|||
|
|||
![]()
@Dismounted
Ok, I've found a way to call PHP "method". It envolves wrapping PHP with WSDL (NuSOAP makes this easy) and referencing it as a service in Visual Studio. I found this information here: http://www.phpeveryday.com/articles/...rt-2--P68.html Can you tell me where I can find the "build_new_post()" function? I will post my progress here, so in the future you can reference people to this topic if they have a similar problem. p.s.: I suppose you guys haven't already wrapped PHP files with WSDL? *looks hopefull* |
#10
|
||||
|
||||
![]() Quote:
Also see newthread.php or newpost.php for an implementation example. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|