Log in

View Full Version : Automated Posting?


Flare
09-26-2002, 07:12 PM
Hi folks,

I hope this is the right forum for this, but here's what I want to do and I'm not exactly sure how to go about it.

I have a private forum that I use for various informational items for my users. All the information I need posted, I store in a MySQL database that I collect from forms that are filled out.

Now, I have this info in the database, but I would like to automatically post it to my vB forums. The databases are on two seperate machines, so injecting the data into the vB database manually would be problematical from a security standpoint (this was the first option I looked at).

What I would like to do is use something like wget (wput?) or even write a custom PHP app that will post a formatted message under my user account to my forums on a sheduled basis (IE - I would setup a cron job).

I can do a lot of things in PHP, but posting to a private forum that requires authentication is a mystery to me. My problem mainly is, I don't even know where to begin with doing something like this, and I was hoping ya'll could shed some light on that.

Thanks,

Flare

Xenon
09-26-2002, 08:09 PM
you have to build a script around this query:
INSERT INTO post (postid,userid,threadid,dateline,visible,pagetext) VALUES (null, your userid, threadid to post in, actual time, 1, and here is all infos you want to have in the post)

not thet will add a post to a thread you specified in whatever forum this thread is in, but it won't upgrade any counters
you should also run this query to get the right ammount of replys in the thread:
UPDATE thread SET replycount=replycount+1,lastpost=actualtime

Flare
09-26-2002, 08:16 PM
Now, I have this info in the database, but I would like to automatically post it to my vB forums. The databases are on two seperate machines, so injecting the data into the vB database manually would be problematical from a security standpoint (this was the first option I looked at).

I can easily inject the data into the database, were the two databases on the same machine, or even if I had "remote" access from one database to the other. But for security reasons, no outside access is allowed to either database, other than from localhost.

I'm looking for a way to essentially simulate a user posting a message into a vB forum.

Xenon
09-27-2002, 10:32 AM
sorry, i missunderstood...

then i've no idea, i didn't work between two servers ;)
sorry

Logician
09-28-2002, 09:18 PM
The easiest way would be to find an host that allows remote connections to MYSQL. You would be most comfortable with this solution. But if this is not an option for you, you have to write a script that submits info in "POST METHOD". Just make sure to add 2 more fields to your default vb new thread form and add username and password there. Of course username you provided should be allowed to access this forum. This should solve the problem if you are trying to create threads by a single poster id.

But if you are trying to move threads of different users with their own username, well this would be still possible but harder to explain how :) (Summary: A new (an alternative newthread.php) script should be written to accept the sender scripts requests)