PHP Code:
$usergroups = $db->query_first("SELECT usergroupid FROM " . TABLE_PREFIX . "usergroup WHERE fmwpermissions > '0'");
$website = $db->query_first("SELECT homepage AS url, homepagetitle AS title FROM " . TABLE_PREFIX . "user WHERE usergroupid IN (" . $usergroups . ") AND homepage != '' AND last" . $vbulletin->options['fmw_last_activity_type'] . " > UNIX_TIMESTAMP(NOW())-" . $vbulletin->options['fmw_last_activity_time'] . " ORDER BY RAND() LIMIT 1");
The first query does not give me the needed results. I am looking for a way of the second query contains a list of usergroups that have a certain custom ugp set to yes.
Sorry forgot to add that this is a plugin within forumhome_loggedinuser