shortcode with conditional results if logged in

Use is_user_logged_in() in the logic to decide what to return.
See https://developer.wordpress.org/reference/functions/is_user_logged_in/

I assume $linkx['link_box'] contains the shortcode.

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