Version: , by Herman
Developer Last Online: Oct 2008
Version: Unknown
Rating:
Released: 01-07-2003
Last Update: Never
Installs: 0
No support by the author.
Template Quick Reply! v1.1
By - Shift
Original Hack by - FireFly(Chen)
First go to [b]AdminCP-> Templates -> phpInclude->
Add this to the bottom of your template:
Code:
//Sticky/Close
if (strpos($_SERVER['PHP_SELF'], 'newreply.php') != false)
{
// These numbers are usergroupids for usergroups that will always
// have permission to close/stick the thread, regardless of what
// permission they already have. To add a usergroup, just follow
// the format (i.e., array(5, 6, 7) allows smods, admins, and any
// mods to close/stick the thread).
// If a usergroupid is not specified then the permissions will
// be automatically derived. It is recommended that you do not
// change this behavior.
$alwaysallowugids = array(5, 6);
$modperms = array();
if (in_array($bbuserinfo['usergroupid'], $alwaysallowugids))
{
// emulate a call to getmodpermissions
$modperms['canopenclose'] = 1;
$modperms['canmanagethreads'] = 1;
}
else
{
$modperms = getmodpermissions($thread['forumid']);
}
// ---------------------------------------------------------------
if ($_POST['action'] == 'postreply') // newreply redirect page
{
$querybits = array();
if ($modperms['canopenclose'])
{
array_push($querybits, "open = " .
($_POST['closeonreply'] == 1 ? 0 : 1));
}
if ($modperms['canmanagethreads'])
{
array_push($querybits, "sticky = " .
($_POST['stickonreply'] == 1 ? 1 : 0));
}
if (!empty($querybits)) // perm to do at least one of the two
{
$threadid = intval($_POST['threadid']);
$querybits = implode(", ", $querybits);
$DB_site->query("UPDATE thread SET $querybits
WHERE threadid = $threadid"); //<
}
}
// ---------------------------------------------------------------
else // just assume this is the reply form
{
// eval the extra option templates as needed
$closebox = '';
$stickbox = '';
if ($modperms['canopenclose'])
{
$checked = ($thread['open'] ? "" : " checked");
eval("\$closebox = \"" . gettemplate("newreply_closebox") . "\";");
}
if ($modperms['canmanagethreads']) // perm for sticky
{
$checked = ($thread['sticky'] ? " checked" : "");
eval("\$stickbox = \"" . gettemplate("newreply_stickbox") . "\";");
}
}
}
if (strpos($_SERVER['PHP_SELF'], 'showthread.php') != false)
{
// These numbers are usergroupids for usergroups that will always
// have permission to close/stick the thread, regardless of what
// permission they already have. To add a usergroup, just follow
// the format (i.e., array(5, 6, 7) allows smods, admins, and any
// mods to close/stick the thread).
// If a usergroupid is not specified then the permissions will
// be automatically derived. It is recommended that you do not
// change this behavior.
$alwaysallowugids = array(5, 6);
$modperms = array();
if (in_array($bbuserinfo['usergroupid'], $alwaysallowugids))
{
// emulate a call to getmodpermissions
$modperms['canopenclose'] = 1;
$modperms['canmanagethreads'] = 1;
}
else
{
$modperms = getmodpermissions($thread['forumid']);
}
// ---------------------------------------------------------------
if ($_POST['action'] == 'postreply') // newreply redirect page
{
$querybits = array();
if ($modperms['canopenclose'])
{
array_push($querybits, "open = " .
($_POST['closeonreply'] == 1 ? 0 : 1));
}
if ($modperms['canmanagethreads'])
{
array_push($querybits, "sticky = " .
($_POST['stickonreply'] == 1 ? 1 : 0));
}
if (!empty($querybits)) // perm to do at least one of the two
{
$threadid = intval($_POST['threadid']);
$querybits = implode(", ", $querybits);
$DB_site->query("UPDATE thread SET $querybits
WHERE threadid = $threadid"); //<
}
}
// ---------------------------------------------------------------
else // just assume this is the reply form
{
// eval the extra option templates as needed
$closebox = '';
$stickbox = '';
if ($modperms['canopenclose'])
{
$checked = ($thread['open'] ? "" : " checked");
eval("\$closebox = \"" . gettemplate("newreply_closebox") . "\";");
}
if ($modperms['canmanagethreads']) // perm for sticky
{
$checked = ($thread['sticky'] ? " checked" : "");
eval("\$stickbox = \"" . gettemplate("newreply_stickbox") . "\";");
}
}
}
//end Sticky/Close
Now save that template then open the showthread template. Then find -
Code:
<!-- first unread and next/prev -->
<table cellpadding="2" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td><smallfont>$pagenav </smallfont></td>
<td align="right"><smallfont>
<img src="https://vborg.vbsupport.ru/vbimages/prev.gif" alt="" border="0">
<a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextoldest">Last Thread</a>
<a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextnewest">Next Thread</a>
<img src="https://vborg.vbsupport.ru/vbimages/next.gif" alt="" border="0">
</smallfont></td>
</tr>
</table>
<!-- first unread and next/prev -->
That should do it! BTW for those of you that have the Shinra Points hack with the addon for points for every post, this works the same way as a normal reply, you should get normal posts with this! ^__^ ALL PHP CODE COPYRIGHT FILBURT1
[b]SCREENSHOT ATTACHED JUST IMAGINE IT WITHOUT THE SMILIES[b]
-Shift
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
<font size="1">Sorry, I meant to, I'll edit the post and add you to it, I really did mean to, I just had alot of things going on when I added the post. And mine would require no php code if the close thread and sticky thread weren't their.