The problem is that number_format(...) changes the resulting variable to a string. If you look back at that code, the variable you are converting ($userthreadviews) is used in an if(...) statement in the next line.
Try the following code:
PHP Code:
$dbview = $DB_site->query_first("SELECT SUM(views) AS totalviews FROM thread");
$allviews = $dbview[totalviews];
$countviews=$DB_site->query_first("SELECT SUM(views) AS views FROM thread WHERE postuserid='$userinfo[userid]'");
$userthreadviews=$countviews['views'];
$threadviewpercent = round(($userthreadviews / $allviews) * 100,2);
$userthreadviews=$countviews['views'];
if ($userthreadviews AND $threadviewpercent <> "0") {
$userthreadviews = number_format($userthreadviews);
eval("\$threadviews = \"".gettemplate("getinfo_threadviews")."\";");
} else {
$threadviews = '';
}
The basic idea is, only use number_format(...) right before you display the value, to ensure that you're not screwing up any future logic (there could be more in this case, I wouldn't know without looking at the whole code...)