You are here

function og_notifications_user_autosubscribe_get in Organic groups 5.8

Same name and namespace in other branches
  1. 5.3 og_notifications/og_notifications.module \og_notifications_user_autosubscribe_get()
  2. 6.2 modules/og_notifications/og_notifications.module \og_notifications_user_autosubscribe_get()
  3. 6 modules/og_notifications/og_notifications.module \og_notifications_user_autosubscribe_get()

Retrieve autosubscription setting for a particular user. -1 in the og_notifications table indicates that the site default is to be used.

Parameters

Integer $uid: The uid of the user.

Return value

Integer 1 or 0 as per the autosubscribe preference.

2 calls to og_notifications_user_autosubscribe_get()
og_notifications_form_alter in og_notifications/og_notifications.module
Implementation of hook_form_alter().
og_notifications_user_autosubscribe in og_notifications/og_notifications.module
Handle autosubscriptions for users when they join a group.

File

og_notifications/og_notifications.module, line 504
Provide notifications and messaging support for organic groups.

Code

function og_notifications_user_autosubscribe_get($uid) {
  $autosubscribe = db_result(db_query("SELECT autosubscribe FROM {og_notifications} WHERE uid = %d", $uid));
  return $autosubscribe == -1 ? variable_get('og_notifications_autosubscribe', 1) : $autosubscribe;
}