+ /*
+ * We create a wall item for every photo, but we don't want to
+ * overwhelm the data stream with a hundred newly uploaded photos.
+ * So we will make the first photo uploaded to this album in the last several hours
+ * visible by default, the rest will become visible over time when and if
+ * they acquire comments, likes, dislikes, and/or tags
+ */
+
+ $r = Photo::selectToArray([], ['`album` = ? AND `uid` = ? AND `created` > ?', $album, $page_owner_uid, DateTimeFormat::utc('now - 3 hours')]);
+
+ if (!DBA::isResult($r) || ($album == DI::l10n()->t(Photo::PROFILE_PHOTOS))) {
+ $visible = 1;
+ } else {
+ $visible = 0;
+ }
+
+ if (!empty($_REQUEST['not_visible']) && $_REQUEST['not_visible'] !== 'false') {
+ $visible = 0;
+ }
+