PDA

View Full Version : Add a custom checkbox for threadposting?


Brother Malachi
07-25-2009, 10:58 PM
Hello everyone,

In terms of php I know how to do this, but in terms of vB i'm clueless.

What I'm trying to do is add a checkbox to the post thread page and if checked it will invoke a different template for that thread.

My guess is I would have to hard code the checkbox, then add a new field for each thread mysql entry that specifies whether the checkbox was checked or not.

Via php that is very easy, but how would I do this using vbulletin? I've never edited vbulletin's php files nor the mysql db.

Is there an easier way to do this?

Dismounted
07-26-2009, 05:36 AM
To add the checkbox, modify the newthread template. You'll likely need to use a hook called newthread_post_complete to execute a query to mark the DB field. (See inside newthread.php.)

Brother Malachi
07-30-2009, 02:53 AM
Hey, thanks for replying.
I looked through the file and my guess is build_new_post is what actually does the mysql insertion.
I added two checkboxes to the template and the two columns to the table.
So how would I go about adding those two boolean values to the table?

Dismounted
07-30-2009, 05:48 AM
Again - the easiest way to approach this is by using a plugin at newthread_post_complete.

ragtek
07-30-2009, 06:29 AM
<a href="https://vborg.vbsupport.ru/showthread.php?t=114249&highlight=thread" target="_blank">https://vborg.vbsupport.ru/showt...ghlight=thread</a>