OpenBSD Journal
Home : : Add Story : : Archives : : About : : Create Account : : Login :


Thresholds can be used to filter out comments based on moderation results. Results consist of count (total number of votes cast), up (number of positive votes), down (number of negative votes) and sum (up - down, possibly negative when down > up). Two kinds of filters can be used.

Simple thresholds

A single numerical value filters out all comments with sum below the specified value.

Advanced thresholds

Arbitrary expressions can specify what comments to show, using the variables c (count), u (up), d (down) and s (sum), like

  • s >= 0 show only comments with sum greater or equal 0
  • (u * 100) / c >= 75 show only comments with at least 75% up votes
  • c < 5 | (u * 100) / c >= 75 same as above, but show comments with less than 5 votes, too
  • c = 0 show only unmoderated comments
  • c > 10 & s < 3 & s > -3 show comments with many votes, but sum near zero (highly polarizing comments)

Arithmetic operators are +, -, * and / (division by zero results in value zero), calculation is floating point.
Comparison operators are = (equal), != (unequal), < (less), <= (less or equal), > (greater) and >= (greater or equal).
Boolean operators are | (or), & (and).
Parentheses work around arithmetic and comparitive parts, not boolean parts (yet).

[ Home | Add Story | Archives | Polls | About ]

Copyright © 2004-2008 Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to April 2nd 2004 as well as images and HTML templates were copied from the fabulous original with Jose's and Jim's kind permission. Some icons from used with permission from Kathleen. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. Search engine is ht://Dig. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]