<?

if ( $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ) {
    //header( 'Content-type: text/html; charset=windows-1251' );
    include_once ROOT_DIR . '/engine/config.php';
    include_once ROOT_DIR . '/engine/function.php';
} else {
    if ( !defined( 'MISOFT' ) ) { exit(); }
}

$sql_klink = mysql_query( "SELECT id, title, description, visits, drweb, google FROM klink WHERE paused = 1 ORDER BY RAND() LIMIT 5" );

if ( mysql_num_rows( $sql_klink ) > 0 ) {
    while ( $row_klink = mysql_fetch_array( $sql_klink ) ) {
        ?>
		 <a href="/surl=<?=$row_klink['id']?>" target="_blank" class="list-group-item list-group-item-action">
			<h5 class="list-group-item-heading" style="font-size: 16px;"><?=wraptitle( $row_klink['title'], 55 )?></h5>
			<p class="list-group-item-text" style="font-size: 14px;"><?=wraptitle( $row_klink['description'], 55 )?></p>
		  </a>
		<?
    }
}
?>