//- Common routines for all views - function getUserPictureUrl (userProfile, which) { if (!userProfile || !userProfile.picture || !userProfile.picture[which]) { return `https://${site.domain}/img/default-member.png`; } return `https://${site.domain}/image/${userProfile.picture[which]._id}`; }