function notifications_feed_user_page in Notifications 5
Same name and namespace in other branches
- 6 notifications_feed/notifications_feed.module \notifications_feed_user_page()
Menu callback. User subscriptions to groups.
1 string reference to 'notifications_feed_user_page'
- notifications_feed_menu in notifications_feed/
notifications_feed.module - Implementation of hook_menu_()
File
- notifications_feed/
notifications_feed.module, line 264 - Subscriptions to FeedAPI feeds
Code
function notifications_feed_user_page($account = NULL) {
global $user;
$account = $account ? $account : $user;
// query string for feed subscriptions
$query = "SELECT s.*, f.value AS nid, n.type AS node_type, n.title FROM {notifications} s \n INNER JOIN {notifications_fields} f ON s.sid = f.sid LEFT JOIN {node} n ON f.value = CAST(n.nid AS CHAR)\n WHERE s.uid = %d AND s.type = 'feed' AND s.event_type = 'feed' AND s.conditions = 1 AND f.field = 'feed-nid'\n ORDER BY node_type, n.title";
$results = pager_query($query, NOTIFICATIONS_FEED_PAGER, 0, NULL, $account->uid);
$subscriptions = $list = array();
$content_types = notifications_content_types('name');
while ($sub = db_fetch_object($results)) {
$subscriptions[$sub->nid] = $sub;
$list[$sub->nid] = l($sub->title, 'node/' . $sub->nid);
}
if (!$subscriptions) {
$output = t('There are no active feed subscriptions.');
}
else {
$defaults = array(
'type' => 'feed',
'event_type' => 'feed',
);
$options = array(
'title' => t('Feed'),
);
$output = drupal_get_form('notifications_user_form', $account, 'feed', $subscriptions, $list, $defaults, $options);
$output .= theme('pager', NOTIFICATIONS_FEED_PAGER);
}
return $output;
}