PDA

View Full Version : Show Only Selected User's Posts


Parker Clack
05-27-2006, 10:00 PM
Description and Usage

This feature allows you to view all posts made by a user in a single thread. This feature is accessed by clicking on the any reply number in a thread listing on the fourmdisplay page. The Who Posted popup will be displayed. Click on the Posts number associated with the username and you will be shown only those posts by that username in a particular thread.

I am using version 3.5.4 and it works well with it.

Download the .zip file and follow the installation instructions.

rmxs
05-28-2006, 05:32 AM
First post :)

Thanks i need this !!!

Ajavas
05-28-2006, 08:16 AM
Installed and it works fine on 3.5.4 :bunny:

Parker Clack
05-28-2006, 04:27 PM
Glad to hear it is working. My members were really wanting this as we had it with version 2.xx. Gaming Force did all the original code I was just able to figure out how to port it over to 3.5.4.

Parker

Parker Clack
05-28-2006, 09:28 PM
I have found a problem in that if a member has several posts in a thread and the number of posts exceeds the max thread view and you go to the next page via the pagenav you will get everyone else in the thread too.

So it will only display the first page of the posts by a particular user.

Anyone have any ideas on how write this to show only the posts by the user over each page you go to? The earliest version of this hack was written by bira for 2.xx and they was written as a separate .php file outside of the showthread page.

Paul M
05-28-2006, 09:33 PM
Those edits to showthread.php should not be necessary - you can alter the sql via plugins. :)

Parker Clack
05-29-2006, 02:28 PM
Paul:

I am not a coder and would appreciate your input into how alter the sql via plugins. Also, if you could look over the sql so that when you click on a number in the Who Posted popup so if the posts are a large number that all of the posts by that member are the only ones that are shown with each page via the pagnav I would appreciate it. Right now it only shows you their posts up to the threadmax limit.

Thanks

Parker Clack
05-30-2006, 02:30 PM
I have updated the .zip to inlcude the following. I have added another change to the showthread.php file.

In showthread.php look for

DEVDEBUG("First Post: $FIRSTPOSTID; Last Post: $LASTPOSTID");

$pagenav = construct_page_nav($vbulletin->GPC['pagenumber'], $perpage, $totalposts, "showthread.php?" . $vbulletin->session->vars['sessionurl'] . "t=$threadid", ""
. (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage" : "")
. "$highlightwords"
);


and change this to

DEVDEBUG("First Post: $FIRSTPOSTID; Last Post: $LASTPOSTID");

$onlybyuserid == $post['userid'];

if ($onlybyuserid != 0) {

$pagenav = construct_page_nav($vbulletin->GPC['pagenumber'], $perpage, $totalposts, "showthread.php?" . $vbulletin->session->vars['sessionurl'] . "t=$threadid&onlybyuserid=$onlybyuserid", ""
. (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage" : "")
. "$highlightwords"
);
} else {

$pagenav = construct_page_nav($vbulletin->GPC['pagenumber'], $perpage, $totalposts, "showthread.php?" . $vbulletin->session->vars['sessionurl'] . "t=$threadid", ""
. (!empty($vbulletin->GPC['perpage']) ? "&pp=$perpage" : "")
. "$highlightwords"
);
}


If anyone can write this as the other changes I have to showthread.php as a plugin I would appreciate it.

Thanks,
Parker

Bigblah
07-15-2006, 10:08 AM
Hey there, I'm a new admin on Gamingforce (whose head admin did the original code for this mod, apparently), and I came across this thread while looking to *ahem* re-implement this feature on our forums -- so thanks for your work on the port :)

I'm using the hook location showthread_query_postids instead of showthread_post_start, and the plugin code is as follows:
$onlybyuserid = trim($_GET['onlybyuserid']);
$onlybyuserid = ($onlybyuserid + 1); // Security
$onlybyuserid = ($onlybyuserid - 1); // Security
if ($onlybyuserid > 0) {
$hook_query_where = "AND post.userid = '$onlybyuserid'";
$highlightwords .= "&onlybyuserid=$onlybyuserid";
}

With this, no changes to showthread.php are needed. And yes, I'm hijacking the $highlightwords variable :)

Tested it and it seems to work fine. This is my first time working with hooks and plugins, so please bear with me if there are any mistakes.

Parker Clack
07-15-2006, 11:41 AM
Bigblah:

Works great. Thanks.

I will modify my .zip file.

Bulent Tekcan
07-17-2006, 11:00 AM
Himmmm good idea,if you available some usergroups will be more good :)

Thanks

bada_bing
07-17-2006, 01:03 PM
Yes I agree this need to be usergroup base as it would make a ggod tool for admins and mods to track all the posts made by the trouble makers on the site

Essam
07-20-2006, 01:03 PM
its good but with usergroupid would be great ..

i used this mod for forumdisplay

$onlybyuserid = trim($_GET['onlybyuserid']);
$onlybyuserid = ($onlybyuserid + 1); // Security
$onlybyuserid = ($onlybyuserid - 1); // Security
if ($onlybyuserid > 0) {
$hook_query_where = "AND thread.postuserid = '$onlybyuserid'";
$highlightwords .= "&onlybyuserid=$onlybyuserid";
}

and place it forumdisplay_query_threadid hook

Parker Clack
07-20-2006, 09:49 PM
Essam:

How is this different? Do we continue to use the other one in showthread_query_postids too?

Parker

Bigblah
07-22-2006, 04:41 PM
I think what Essam's doing is to show only the threads created by a certain user in the forum display. (i.e. it's a separate feature)

Bulent Tekcan
12-11-2006, 09:29 AM
Is it available 3.6.4 ?

Thanks

noonespecial
02-12-2007, 06:02 AM
3.6?