pagenavi shows a lot of pages calculated from all posts in the site with query_posts

I didn’t load the plugin to check and I never use query_posts(), but perhaps tie_pagenavi() is depending on the value in the $paged global variable. Try adjusting that value before (or after) calling query_posts(). Here is the code to adjust it before calling query_posts().

if ( get_query_var( 'paged' ) )
    // On a paged page.
    $paged = get_query_var( 'paged' );

else
    $paged = 1;

query_posts( "paged={$paged}&posts_per_page={$cat_query}" );

if ( function_exists( 'tie_pagenavi' ) )
    tie_pagenavi();

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