$query = $_SGLOBAL['db']->query("SELECT blogid,subject FROM ".tname('blog')." WHERE blogid>'$id' AND uid='$space[uid]' ORDER BY blogid ASC LIMIT 0,1 ");
$query = $_SGLOBAL['db']->query("SELECT blogid,subject FROM ".tname('blog')." WHERE blogid<'$id' AND uid='$space[uid]' ORDER BY blogid DESC LIMIT 0,1 ");