Auto form submit
#1
I basically need a plugin that submits a form every time a post is made (basically it's telling my chatbox that a post was made). Is this possible, and if so how could I go about doing it? Right now I don't understand much about mybb, but I am willing to learn if you will walk through this with me.
Reply
#2
It depends on how your chatbox checks if a new post was made.
All my plugins are available for free at MyBB Extend and on my GitHub. MyBB-Plugins.com has been closed and none of my plugins are officially maintained or supported.
Reply
#3
I have to submit a form to their website, which then pushes back to my chatbox.
<iframe width=0 height=0 src='chatboxsubmit.php?poster=mybb-> *user of last post*&link=mybb-> *link to last post*&title=mybb-> *title of thread last posted in *;' onload='JAVASCRIPT:this.theForm.submit();'></iframe>  
chatboxsumbit.php would contain the code that autosubmits a form, but I would have to know how to pull the last post made. I would also need to know where to place the iframe in order to force it to update the chatbox only on a new post.

Psuedocode example:
//file: chatboxsubmit.php
<form id='theForm' action='someotherwebstie.html' method='POST' >

         <input type='hidden' id='nme' value="Forum Bot" />
<?php

        $message = $_GET['poster'] . " posted in the thread [url='" . $_GET['link'] . "']" . $_GET['title'] . "[/url].";
        

?>

      <input type='hidden' name='pst' value="<?php echo($message); ?>" />

</form>

Basically when a post event occurs I need to have that iframe injected into the current page so taht it will update the chat box.
Reply
#4
Bump, I need some help :/
Reply
#5
PHP can't auto submit forms, PHP is back-end and not front-end thus you'd most likely require javascript. Unless you want to create an HTTP request and send it via PHP.
All my plugins are available for free at MyBB Extend and on my GitHub. MyBB-Plugins.com has been closed and none of my plugins are officially maintained or supported.
Reply
#6
I think a plugin that uses the hooks newthread_do_newthread_end & newreply_do_newreply_end to fetch the post info, then use curl to submit the form info to the remote server.
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Reply
#7
(2011-09-02, 11:41 AM)dvb Wrote: I think a plugin that uses the hooks newthread_do_newthread_end & newreply_do_newreply_end to fetch the post info, then use curl to submit the form info to the remote server.

How would one go about starting to do such?
Reply
#8
1. http://www.google.com/search?q=mybb+plugin+tutorial
2. using php & curl to submit a form

Please ask specific questions if you want specific answers Smile
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Reply
#9
(2011-09-03, 06:43 PM)dvb Wrote: 1. http://www.google.com/search?q=mybb+plugin+tutorial
2. using php & curl to submit a form

Please ask specific questions if you want specific answers Smile

I asked for a tutorial on how to program the problem that I wrote :o, I don't see how I can be more specific when asking such a big question?
Reply
#10
Do you know php?
Do you know how to write a plugin for mybb?
Do you know how to use curl?
Do you understand the steps required to accomplish what you're trying to do?
Creativity is a drug I cannot live without.
[Image: 1]Support PM will be ignored
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)