0

Basically, I have a program in Delphi which POSTs data to a MyBB script on a server, when the MyBB script recieves that POSTed data it is supposed pass that data onto a MyBB forum and use it to post a new thread.

The only problem is I have no idea how to do the second part which is sending the data to the MyBB forum.
Potential problems I can see is:
- Logging in?
- Thread title and thread content?

Also I need to search the forum before posting, like if a certain thread title already exists then it posts a new post but if the thread title does not already exist then it posts a new thread.

I've had a look at API's but the only thing I've found is APIs which return forum data rather than POST forum data so I'm a bit lost on what to do now. Can anyone help? Thanks a million!

3
Contributors
7
Replies
18
Views
5 Years
Discussion Span
Last Post by Erik_6
0

Ye, basically I have the forums on a sub-domain called something like forums.domain.com and the script will be on another sub-domain called something like scripts.domain.com/script.php

0

OK, so you have access to all your code and, more importantly to the DB. You could just interact directly with the DB, short-circuiting the MyBB front-end. However, this is a potential security problem unless you lock it down. This may also cause problems wrt data integrity. I'm not well versed with MyBB, but some forum apps write to more than one table when posting a new thread. This may have cascading effects, e.g. updating a search table with keywords. So it may be worth looking at the base code for MySQL queries and functions that are run on new thread post. Just a thought.

I'm assuming that this is for your own use and not just anybody who's a member of your forum.

//EDIT
If this apporach is something you're considering - perhaps looking at cross-sub-domain session would be useful, using csrf prevention, or in other words - use a token that can ensure that data arriving at your posting script for the DB is actually coming from your initiator php page.

Perhaps handing off your delphi stuff to a php file which can send data to the forum script via cURL or sockets. I'd look at cURL.

Edited by diafol

0

Well I'm just a developer really, I can have access to the DB's but I would really prefer not to go near them. My aim is to use the MyBB interface to do all the complex stuff such as putting data onto the DB and hasing the logins.

Also my program has multiple users so it has to be a viable solution which can keep them in mind.

0

I just read your edit and this is the second time someone has mentioned cURL to me, the thing is version of Delphi I use doesn't support cURL properly but I can POST data. I have never used cURL before and don't understand what it does exactly but is POSTing data to the script a good alternative, can you help me out with a explanation of how cURL can help.

0

OK, there's a decent post cURL example here: http://www.php.net/manual/en/function.curl-exec.php#98628

OK, your Delphi script/form posts data to a php file on the same domain which takes the data, cleans/validates it and does further processing. Once the data is in usable form, you pass it to a script in the forum subdomain using cURL. This use is a way of sending POST data without using a form.

Effectively you're spoofing the login form.
You can send login details to the login script in your forum files - I'm not sure where this is in MyBB - also, I'm not sure about how the session data is set up and how a cURL post affects this compared to a normal login routine. Unfortunately I'm at the limit of the help I can offer.

Anybody else?

Edited by diafol

-1

@DelphiGuy have you ever gotten this going?

I am in the process of developing a home page for the www.platinumwealth.co.za forum, but I would also like to have news content on the main page be posted as a thread like this, basically exactly like this.

I will put all the needed data in php ready to be posted, I also just need to know how to achieve exactly this.

All help greatly appreciated.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.