What happens in DB after a new message is posted?

Started by qureshi, March 23, 2008, 09:48:44 AM

Previous topic - Next topic

qureshi

Hi,

When a user posts a new message, what tables are updated? I know messages table is, but are there others?

Nadeem

Spaceman-Spiff

On top of my head, I'm guessing...

log_activity, members (+postcount), topics (last post id), and maybe some more for statistics purposes.

You should check Sources\Post.php for details.

qureshi

Thanks!!!

I don't understand a bit of post.php. That level of PHP is Waaay above me.

If you can recall more table, that would be great! :-)

Nadeem

Spaceman-Spiff

If you're making a custom post page, perhaps you can direct the form so SMF can handle it.

For example, the html code for Quick Reply on this forum:

<form action="http://www.simplemachines.org/community/index.php?action=post2" method="post" accept-charset="UTF-8" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
            <input type="hidden" name="topic" value="230172" />
            <input type="hidden" name="subject" value="Re: What happens in DB after a new message is posted?" />

            <input type="hidden" name="icon" value="xx" />
            <input type="hidden" name="notify" value="0" />
            <input type="hidden" name="not_approved" value="" />
            <input type="hidden" name="goback" value="1" />
            <input type="hidden" name="num_replies" value="2" />
            <textarea cols="75" rows="7" style="width: 95%; height: 100px;" name="message" tabindex="1"></textarea><br />
            <input type="submit" name="post" value="Post" onclick="return submitThisOnce(this);" accesskey="s" tabindex="2" />
            <input type="submit" name="preview" value="Preview" onclick="return submitThisOnce(this);" accesskey="p" tabindex="4" />

            <input type="button" value="Spell Check" onclick="spellCheck('postmodify', 'message');" tabindex="5" />
            <input type="hidden" name="sc" value="xxx" />
            <input type="hidden" name="seqnum" value="4683805" />
         </form>


You just need to modify the values there, and let the form be handled by ?action=post2

Not sure if this will work, never done it myself... and not sure what seqnum is used for. Maybe some security check.

qureshi

Hi,

Thanks for the info!

Actually, I'm trying to make a plugin for Joomla 1.5.2 that inserts my new articles into my SMF forum, since the Jooma-SMF bridge was discontinued.

Nadeem

Advertisement: