Sador
01-22-2010, 10:00 PM
Thread management in quick reply
I've used this on my vBulletin 3.x forum for quite some time, but unfortunately it didn't work in vBulletin 4 anymore. I noticed there wasn't anyone making this mod, so I decided to make it myself and share it with you guys.
Description:
This is a pretty small mod that will add 2 checkboxes in your quick reply for those that have permissions to use it. With those checkboxes you'll be able to open, close, stick and unstick the thread you're in when you submit a message using the quick reply.
You don't need to set any special permissions or anything, if a user has the permissions to open, close, stick or unstick threads in the forum they're in they will automatically be able to use this. If not, they won't even see it, of course.
Now for the actual mod:
Go to your Admin CP, to Styles & Templates, Style manager, edit templates.
Now, in SHOWTHREAD find:
{vb:rawphrase show_your_signature}
<div class="blockrow" id="aftersubmit">
</vb:if>
</div>
after add:
<vb:if condition="$show['openclose']">
<li><label for="cb_openclose"><input type="checkbox" name="openclose" id="cb_openclose" value="1" tabindex="1" {vb:raw checked.openclose} /> <vb:if condition="$show['closethread']">{vb:rawphrase close_this_thread}<vb:else />{vb:rawphrase reopen_this_thread}</vb:if></label></li>
</vb:if>
<vb:if condition="$show['stickunstick']">
<li><label for="cb_stickunstick"><input type="checkbox" name="stickunstick" id="cb_stickunstick" value="1" tabindex="1" {vb:raw checked.stickunstick} /> <vb:if condition="$show['unstickthread']">{vb:rawphrase unstick_this_thread}<vb:else />{vb:rawphrase stick_this_thread}</vb:if></label></li>
</vb:if>
Now you need to edit the showthread.php file.
Find:
// build quick reply if appropriate
if ($show['quickreply'])
{
require_once(DIR . '/includes/functions_editor.php');
$show['wysiwyg'] = ($forum['allowbbcode'] ? is_wysiwyg_compatible() : 0);
// set show signature hidden field
$showsig = iif($vbulletin->userinfo['signature'], 1, 0);
After add:
// can this user stick this thread?
if (can_moderate($threadinfo['forumid'], 'canmanagethreads'))
{
$show['stickunstick'] = true;
}
else
{
$show['stickunstick'] = false;
}
if ($show['openclose'] OR $show['stickunstick'])
{
$show['closethread'] = iif($threadinfo['open'], true, false);
$show['unstickthread'] = iif($threadinfo['sticky'], true, false);
}
else
{
$threadmanagement = '';
}
All done.
There are two small disadvantages:
- You need to edit showthread.php, so you might have to do the edit again when you overwrite the file (for example when upgrading vBulletin).
- You need to do the template edit for every style you want it in.
I don't know if it's even possible to do this mod another way so you won't have those problems, but it's not in my capabilities anyway. Support will probably be limited, sorry for that.
Also, thanks to Lynne for helping me getting this to work.
Have fun with this mod and please mark as installed if you decide to use it.
I've used this on my vBulletin 3.x forum for quite some time, but unfortunately it didn't work in vBulletin 4 anymore. I noticed there wasn't anyone making this mod, so I decided to make it myself and share it with you guys.
Description:
This is a pretty small mod that will add 2 checkboxes in your quick reply for those that have permissions to use it. With those checkboxes you'll be able to open, close, stick and unstick the thread you're in when you submit a message using the quick reply.
You don't need to set any special permissions or anything, if a user has the permissions to open, close, stick or unstick threads in the forum they're in they will automatically be able to use this. If not, they won't even see it, of course.
Now for the actual mod:
Go to your Admin CP, to Styles & Templates, Style manager, edit templates.
Now, in SHOWTHREAD find:
{vb:rawphrase show_your_signature}
<div class="blockrow" id="aftersubmit">
</vb:if>
</div>
after add:
<vb:if condition="$show['openclose']">
<li><label for="cb_openclose"><input type="checkbox" name="openclose" id="cb_openclose" value="1" tabindex="1" {vb:raw checked.openclose} /> <vb:if condition="$show['closethread']">{vb:rawphrase close_this_thread}<vb:else />{vb:rawphrase reopen_this_thread}</vb:if></label></li>
</vb:if>
<vb:if condition="$show['stickunstick']">
<li><label for="cb_stickunstick"><input type="checkbox" name="stickunstick" id="cb_stickunstick" value="1" tabindex="1" {vb:raw checked.stickunstick} /> <vb:if condition="$show['unstickthread']">{vb:rawphrase unstick_this_thread}<vb:else />{vb:rawphrase stick_this_thread}</vb:if></label></li>
</vb:if>
Now you need to edit the showthread.php file.
Find:
// build quick reply if appropriate
if ($show['quickreply'])
{
require_once(DIR . '/includes/functions_editor.php');
$show['wysiwyg'] = ($forum['allowbbcode'] ? is_wysiwyg_compatible() : 0);
// set show signature hidden field
$showsig = iif($vbulletin->userinfo['signature'], 1, 0);
After add:
// can this user stick this thread?
if (can_moderate($threadinfo['forumid'], 'canmanagethreads'))
{
$show['stickunstick'] = true;
}
else
{
$show['stickunstick'] = false;
}
if ($show['openclose'] OR $show['stickunstick'])
{
$show['closethread'] = iif($threadinfo['open'], true, false);
$show['unstickthread'] = iif($threadinfo['sticky'], true, false);
}
else
{
$threadmanagement = '';
}
All done.
There are two small disadvantages:
- You need to edit showthread.php, so you might have to do the edit again when you overwrite the file (for example when upgrading vBulletin).
- You need to do the template edit for every style you want it in.
I don't know if it's even possible to do this mod another way so you won't have those problems, but it's not in my capabilities anyway. Support will probably be limited, sorry for that.
Also, thanks to Lynne for helping me getting this to work.
Have fun with this mod and please mark as installed if you decide to use it.