<?php
$r=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='".$user['id']."'"
);
$msf=mysql_num_rows(mysql_query("SELECT * FROM `f_message` WHERE `user`='".$user['id']."'"
);
$qp=$msf+(forumPost($r['id']))/5+($r['on_time'])/900;
?>
попробуй так, хз