- // check service class limits
-
- $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE `uid` = %d AND `pending` = 0 AND `self` = 0",
- intval($uid)
- );
- if (dbm::is_result($r))
- $total_contacts = $r[0]['total'];
-
- if (! service_class_allows($uid,'total_contacts',$total_contacts)) {
- $result['message'] .= upgrade_message();
- return $result;
- }
-
- $r = q("SELECT COUNT(`network`) AS `total` FROM `contact` WHERE `uid` = %d AND `network` = '%s' AND `pending` = 0 AND `self` = 0",
- intval($uid),
- dbesc($network)
- );
- if (dbm::is_result($r)) {
- $total_network = $r[0]['total'];
- }
-
- if (! service_class_allows($uid,'total_contacts_' . $network,$total_network)) {
- $result['message'] .= upgrade_message();
- return $result;
- }
-