return bbp_get_topic_author_id as integer

The problem is that $user_id = bbp_get_topic_author_id( $topic_id = 0 ) is malformed. You need to remove the = 0 from $topic_id = 0 and make sure that the variable $topic_id actually contains the ID of the topic you are trying to get the author of.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)