NTLDR
01-11-2004, 10:00 PM
Author: NTLDR
Version: 1.0.0
vB Compatibility: vB3 Gamma, RC1, RC2
Description:
This hack will allow you to only show posts by a specific user on showthread.php.
Usage:
showthread.php?threadid=1&userid=X
showthread.php?threadid=1&username=Y
(i.e add &userid=X for all posts by userid X or &username=Y for all posts by user Y).
File Edits:
In showthread.php find:
if ($threadedmode == 0)
{
Add after:
// EDIT ################################################## ######################
// get posts by a specific user only
if (!empty($_REQUEST['userid'])) {
$usersql = 'AND post.userid = '.intval($_REQUEST['userid']);
$uidwhere = true;
} elseif (!empty($_REQUEST['username'])) {
$fetchuserid = $DB_site->query_first("SELECT userid FROM ".TABLE_PREFIX."user WHERE username = '".addslashes($_REQUEST['username'])."'");
$uidwhere = false;
if (empty($fetchuserid['userid'])) {
$idname = $vbphrase['user'];
eval(print_standard_error('error_invalidid'));
} else {
$usersql = 'AND post.userid = '.intval($fetchuserid['userid']);
}
} else {
$usersql = '';
$uidwhere = false;
}
// END EDIT ################################################## ##################
Find:
WHERE threadid = $threadid AND visible = 1 $delthreadlimit
Add after:
$usersql
Find (just after the last edit):
WHERE threadid = $threadid AND visible = 1
Add after:
$usersql
Find:
$postids = "post.postid IN (0" . $ids . ")";
Add after:
if (empty($ids) && $uidwhere) {
$idname = $vbphrase['userid'];
eval(print_standard_error('error_invalidid'));
}
Done!
Please click install if you use this hack :)
Version: 1.0.0
vB Compatibility: vB3 Gamma, RC1, RC2
Description:
This hack will allow you to only show posts by a specific user on showthread.php.
Usage:
showthread.php?threadid=1&userid=X
showthread.php?threadid=1&username=Y
(i.e add &userid=X for all posts by userid X or &username=Y for all posts by user Y).
File Edits:
In showthread.php find:
if ($threadedmode == 0)
{
Add after:
// EDIT ################################################## ######################
// get posts by a specific user only
if (!empty($_REQUEST['userid'])) {
$usersql = 'AND post.userid = '.intval($_REQUEST['userid']);
$uidwhere = true;
} elseif (!empty($_REQUEST['username'])) {
$fetchuserid = $DB_site->query_first("SELECT userid FROM ".TABLE_PREFIX."user WHERE username = '".addslashes($_REQUEST['username'])."'");
$uidwhere = false;
if (empty($fetchuserid['userid'])) {
$idname = $vbphrase['user'];
eval(print_standard_error('error_invalidid'));
} else {
$usersql = 'AND post.userid = '.intval($fetchuserid['userid']);
}
} else {
$usersql = '';
$uidwhere = false;
}
// END EDIT ################################################## ##################
Find:
WHERE threadid = $threadid AND visible = 1 $delthreadlimit
Add after:
$usersql
Find (just after the last edit):
WHERE threadid = $threadid AND visible = 1
Add after:
$usersql
Find:
$postids = "post.postid IN (0" . $ids . ")";
Add after:
if (empty($ids) && $uidwhere) {
$idname = $vbphrase['userid'];
eval(print_standard_error('error_invalidid'));
}
Done!
Please click install if you use this hack :)