global $show; if (is_array($options)) { $options = array_merge($this->option_defaults, $options); } else { $options = $this->option_defaults; } require_once(DIR . '/includes/functions_album.php'); $state = array('public'); if (can_view_private_albums($this->profile->userinfo['userid'])) { $state[] = 'private'; } if (can_view_profile_albums($this->profile->userinfo['userid'])) { $state[] = 'profile'; } if (!$this->profile->prepared['myprofile']) { if (!can_moderate(0, 'canmoderatepictures')) { $sql = "AND album.visible > 0"; } else { $sql = "AND (album.visible > 0 OR album.moderation > 0)"; } } else { $sql = ""; } $albums = $this->registry->db->query_read_slave(" SELECT album.*, a.attachmentid, album.moderation, fd.thumbnail_dateline, fd.thumbnail_width, fd.thumbnail_height, IF(fd.thumbnail_filesize > 0, 1, 0) AS hasthumbnail FROM " . TABLE_PREFIX . "album AS album LEFT JOIN " . TABLE_PREFIX . "attachment AS a ON (album.coverattachmentid = a.attachmentid) LEFT JOIN " . TABLE_PREFIX . "filedata AS fd ON (fd.filedataid = a.filedataid) WHERE album.userid = ". $this->profile->userinfo['userid'] . " AND album.state IN ('" . implode("', '", $state) . "') $sql ORDER BY album.lastpicturedate DESC "); $albumbits2 = ''; while ($album = $this->registry->db->fetch_array($albums)) { $album['picturedate'] = vbdate($this->registry->options['dateformat'], $album['lastpicturedate'], true); $album['picturetime'] = vbdate($this->registry->options['timeformat'], $album['lastpicturedate']); $album['title_html'] = fetch_word_wrapped_string(fetch_censored_text($album['title'])); $album['coverdimensions'] = ($album['thumbnail_width'] ? "width=\"$album[thumbnail_width]\" height=\"$album[thumbnail_height]\"" : '');if ($album['moderation']) { $album['moderatedcount'] = vb_number_format($album['moderation']); $show['moderated'] = true; } else { $show['moderated'] = false; } $templater = vB_Template::create('memberinfo_block_photosbit'); $templater->register('album', $album); $albumbits2 .= $templater->render(); } $this->block_data['albumbits2'] = $albumbits2;vB_Template::preRegister('memberinfo_block_photos', array('userinfo' => $userinfo));vB_Template::preRegister('memberinfo_block_photos', array('albumbits2' => $albumbits2));