PDA

View Full Version : Reputation-Based Post Filtering


TWTCommish
01-08-2004, 10:00 PM
I like the reputation system, but came to the conclusion early on that it wouldn't be particularly pragmatic unless modified. It's good for cutting down on "right on!" posts, but it's rather like warning someone on AIM; it doesn't have much of a tangible effect. Until now, that is. :)

This hack, when employed, will filter out posts by any user with less than X number of reputation points. It is customizable for each user, so if someone wishes to screen out all posts by an individual with negative rep points, they can, and if someone wants to let all posts through, they can as well.

The filter does not skip over the posts, but rather, hides them in a way very similar to the Ignore List. This hack requires the addition of one custom field, three code edits in two files, two new phrases, and one new template.

Step One
Create a new User Profile Field. Choose "Single-Selection Menu" and enter the following criteria:

Title: Reputation-Based Filtering


Description: Filter out posts by users with less than a certain number of reputation points.


Options (substitute your own):
-1
-10
-25
-50
-100
-200
-300


Field Required: No.
Field Editable by User? Yes
Field Hidden on Profile? No
Field Searchable on Members List? No
Show on Members List? No
Allow user to input their own value for this option - No
Which page displays this option? Options: Thread Viewing
Once you're done with this, go to your User Profile Field Manager and make note of the new field's name; IE: field5, field6, etc.


Step Two
Open showthread.php, and find this around line 87:

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
Right after it, add this:

if (strlen($bbuserinfo[field6])) {
$reputationfilter = $bbuserinfo[field6];
}
Change "field6" to your own field name, determined in Step One.

Still in showthread.php, find this:

while ($post = $DB_site->fetch_array($posts))
{
Right after it, add this:

$post[reputationfilter] = $reputationfilter;

Save and close.


Step Three
Open functions_showthread.php in your /includes directory. Find this:

$show['messageicon'] = iif($post['iconpath'], true, false);
eval('$retval = "' . fetch_template($maintemplatename) . '";');
return $retval;
Right BEFORE it, add this:

if ($post[reputation] < $post[reputationfilter])
{
$maintemplatename = 'postbit_filter';
}


Step Four
Add the following phrases:

message_hidden_x_filter
This message is hidden because <strong>{1}</strong>'s reputation does not meet your <a href="{2}" target="_blank">specified standards</a>.

change_reputation_filter
Change Reputation Filter

Step Five
Add the template found in the attached text file.

All done! Screenshot of what a filtered post looks like below.

FleaBag
01-09-2004, 02:05 PM
Excellent work as always Chris, I know I can expect the same quality as that in your vB2 hacks so on upgrading I will definitely install this! :D

NTLDR
01-09-2004, 07:36 PM
Nice and original hack idea :D Thanks for sharing with the community.

Gio Takahashi
01-09-2004, 10:59 PM
Installed without problem. Good job, this will definitely encourage people to use the reputation system.

Link14716
01-10-2004, 03:25 AM
Nice job. :)

boardster
01-20-2004, 11:21 AM
Hi TWTCommish

Great hack!

Is it possible to modify this hack to filter out posts (NOT users) with less than X number of reputation points?

TWTCommish
01-20-2004, 12:49 PM
Is it possible to modify this hack to filter out posts (NOT users) with less than X number of reputation points?You mean specific posts that have been marked down? I suppose so, yeah. Wasn't planning it, if only because you'd need to have a huge board for such a hack to have much meaningful effect.

Mr. Brian
02-05-2004, 07:19 PM
That's cool.. Gonna install it right now!

You gonna receive a feedback from someone soon. ".)

Mr. Brian
02-05-2004, 09:57 PM
Thumbs up!!!

Keep up the good work bro.. ;)

TWTCommish
02-05-2004, 10:11 PM
Thumbs up!!!

Keep up the good work bro.. ;)
Thanks very much, Matt. :) Glad you like it. I think giving reputation a more tangible effect changes the entire dynamic of a given forum. It's a step closer to a self-moderating community.

Princeton
02-06-2004, 02:06 PM
great hack will install ...

buro9
02-06-2004, 02:34 PM
You mean specific posts that have been marked down? I suppose so, yeah. Wasn't planning it, if only because you'd need to have a huge board for such a hack to have much meaningful effect.
Actually that's what I was looking for.

Members are inconsistent... sometimes they talk tripe... othertimes it's quality stuff... we'd want specific posts to be excluded a.l.a Slashdot.

This would also give us a chance to use it for things like moderating down posts which we don't want google to spider... because we could set 'guest' to have a low tolerance... which means that we could avoid attracting perverts, etc to the forum.

Post based reputation filtering my community would love. They have a big problem with member based filtering

Dean C
02-06-2004, 03:28 PM
I can see this going down a storm on several boards I visit :)!

Mr. Brian
02-09-2004, 04:52 PM
That's weird..

For no reason, or.. maybe Yes..?

I found that the post filtering system seem totally disappeared from my forum..

Cold Steel
04-26-2004, 08:44 PM
/me installs.

Cold Steel
04-27-2004, 05:49 PM
This works great, except our user with the lowest reputation (-1912) has a green bar.

DalaiLamaBob
04-27-2004, 06:58 PM
This works great, except our user with the lowest reputation (-1912) has a green bar.

Wrong hack. But I did mention that too in the thread with that hack.

Cold Steel
04-27-2004, 07:29 PM
Oops, sorry. Please ignore my above post.

Sanity
07-02-2004, 10:06 AM
Great and pretty usefull hack, but i get a parse error in line 87 (step 2). I changed the field number to5 as it is my number in the new added profile.

Whats my mistake?

vb3.0.1

euangel
08-15-2004, 05:59 PM
Great hack...THANKS!