Shortcode doesn’t work if I directly paste its function in a template file?

I think you’re looking for the do_shortcode() function. It allows you to paste a shortcode directly into a template file.

http://codex.wordpress.org/Function_Reference/do_shortcode

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