Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Any scripts that will make posts for me?

Aloittaja ketchup, lokakuu 15, 2006, 06:44:23 IP

« edellinen - seuraava »

ketchup

Any scripts out there that will aloow me to set it up so it will post automatically? Like it can grab a headlin from the news or somehting?  :D


Oldiesmann

You can do it quite easily with SMF 1.1 RC3 - just include Subs-Post.php and pass the appropriate info off to the createPost() function. See http://dev.simplemachines.org/function_db/index.php?action=view_function;function=377 for more info on that function.
Michael Eshom
Christian Metal Fans

motumbo

Wow, there is a lot of new documentation and it is really nice.

Oldies, I have a question for you:

Does the person running the script have to be logged in to SMF?  Do I need to log into SMF, upload a PHP file containing createpost() up to the server then navidate to the just uploaded PHP file to run it?

What I had been doing to automate posts is use a script that I ran to take data from a MySQL DB and create INSERT queries which I then ran on the SMF DB.  It works just fine.  But I think these functions will be much more efficient and just what I'm looking for.

I figured I'd ask a quick question before devoting a lot of time learning how to do this. 

Thanks.

PS:  It would be nice if the function DB contained little snippets of code using the functions properly  ;)

SleePy

#3
No They do not have to be logged in.. But I suggest it cuss you are able to grab more info from the user.. Such as in my script I have it getting the users information like msn and such for an application script I have so it really auto fills about 75% of the script out and thus allows the user to finish the application quicker.



$topicOptions = array(
'id' => 0,   // 0 = New Topic otherwise Topic id to reply..
'board' => $forummsg['board'],  //What board to post on.. User doesn't even need rights to view it..
'mark_as_read' => false,
);
$posterOptions = array(
'id' => (isset($ID_MEMBER) ? $ID_MEMBER : 0),
'name' => $forummsg['name'],
'email' => $forummsg['email'],
'ip' => $forummsg['IP'],
'update_post_count' => 0,
);
$msgOptions = array(
'id' => 0,
'subject' => $forummsg['title'],
'body' => $forummsg['body'],
);
createPost ($msgOptions,$topicOptions,$posterOptions);

Thats How I used it.. the variables Are setup in other parts of my script from an array.. but it dont have to come from an array..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: