Yahya related to me from Malik from Sumayy, the mawla of AbuBakr, that Abu Bakr ibn Abd ar-Rahman used to say, "Someone who goesto the mosque in the morning or the afternoon with no intention ofgoing anywhere else, either to learn good or teach it, is like someonewho does jihad in the way of Allah and returns with booty."
USC-MSA web (English) reference: Book 9, Hadith 56
Arabic reference: Book 9, Hadith 387