What is wrong with this code?

You are using get_post_type as variable instead of a function try:

function themeperauthor_need_switch() {
    global $post;
  if ( get_post_type($post) == 'weblogs' )  {
    return get_the_author_meta('themeperauthor', $user->ID);
  }
  return "";
}

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