The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
New post from another server
What is the best way to submit a new post from a seperate server using php ? Not interested in RSS feeds.
If I'm doing data entry for another website, I want to tick a box and have it create a new post on my forum. I do have php programming experience, I just have no idea where to start with this. |
#2
|
||||
|
||||
You could create a php script, which uses a defined user account in forum#2 to log in and send a POST request to newthread / newreply.php with the post data you want to send.
depending on your php experience, you should take a look at the curl docs on php.net |
#3
|
|||
|
|||
Looks like a great place to start. Is there an example of posting an new thread (containing html) with a user account ?
I took a look at the variables and arrays in newthread.php, and there's alot. No problem using cURL to send the data, just need to know what data is essential, and if it can handle html. |
#4
|
||||
|
||||
Well, this is what a quick reply form looks like:
Attachment 130860 You should be able to recognize what you will need to send. The securitytoken will be a problem, you'll need to login, download the frontpage to get your generated securitytoken (it's in the html code in plaintext, so you just need some regex to grab it). The login method is also a POST request to the login form. You'll need a securitytoken again, so this is a bit of code and tricks to get it working, but it's doable. Another method would be to create some kind of API script on your server, which accepts all the necessary post data and inserts them into the database directly. You'll need to have an idea of the internal vbulletin functions to create posts/threads OR you try to inject it directly with a mysql query. Biggest problem will be to make the script secure, but then again you simply need to check the request IP for equality with the server ip running the mod. Here are neat examples on how to use curl for simple GET/POST requests: http://de3.php.net/manual/en/functio...exec.php#98628 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|