Hi,
I'm trying to create a new post from my own script in PHP, as sort of a 'bot' posting.
this is my script so far: pastebin.com/RmFE0Wfm ( can't post links :( )
when I load the page, this is the error I'm getting:
Fatal error: Unsupported operand types in /home/content/30/11386330/html/forum/Sources/Subs-Db-mysql.php on line 51
$smcFunc += array(
'db_query' => 'smf_db_query',
'db_quote' => 'smf_db_quote',
'db_fetch_assoc' => 'mysql_fetch_assoc',
'db_fetch_row' => 'mysql_fetch_row',
'db_free_result' => 'mysql_free_result',
'db_insert' => 'smf_db_insert',
'db_insert_id' => 'smf_db_insert_id',
'db_num_rows' => 'mysql_num_rows',
'db_data_seek' => 'mysql_data_seek',
'db_num_fields' => 'mysql_num_fields',
'db_escape_string' => 'addslashes',
'db_unescape_string' => 'stripslashes',
'db_server_info' => 'mysql_get_server_info',
'db_affected_rows' => 'smf_db_affected_rows',
'db_transaction' => 'smf_db_transaction',
'db_error' => 'mysql_error',
'db_select_db' => 'mysql_select_db',
'db_title' => 'MySQL',
'db_sybase' => false,
'db_case_sensitive' => false,
'db_escape_wildcard_string' => 'smf_db_escape_wildcard_string',
); -- LINE 51
I don't do much PHP coding so I'm having a lot of trouble in the past few days just trying to make a script to post something on my forum
Thanks.
Hi Whitetigerswt and welcome around! :)
That one should work:
http://pastebin.com/Vp7EsJEg
;)
Thanks so much!
Guys, this script uses a function named "createPost".
Where is that one defined (neither of the SSI & smf_2_api scripts has it) ?
Note : the original script is missing on pastebin.
Edit : Allright, I was looking in APIs, when this is a core function. Sorry about that.
Easy, load SSI.php, load Subs-Post.php, run createPost.
Yep, as mentionned in my edit, was looking in the wrong place.
Sorry'bout that.
Edit : By the way --> this works like a charm. Trying a few API style calls to create/authenticate/connect users and create/reply to posts work so good, that I finally decided to use SMF as the board tool of my web app.
This and the reactive community of course.