The IF() in the original code is an SQL if(), not a PHP if().
The format for SQL if() can be found here:
http://dev.mysql.com/doc/refman/5.0/...functions.html
What the first IF() statement is saying is:
Code:
if 'votenum' is greater than or equal to '5' and 'votetotal' divded by 'votenum' is less than or equal to '2', then return '0'
The second one is saying:
Code:
if 'votenum' is greater than or equal to 5 and 'votetotal' devided by 'votenum' is greater than or equal to '3', then return '1', otherwise return 'open' (which in this case is 0)
As for the double quotes, they are there because the Jelsoft code standards say that all SQL should be enclosed in double quotes.
The 'false' at the end of the set() method indicates that the data being passed (in this case the SQL statement) doesn't need to be cleaned by vBulletin (characters converted, etc)
Look up the set() method in class_dm.php for more info on it's arguments.