function subscriptions_blogs in Subscriptions 5
get list of blog entries, return form
1 call to subscriptions_blogs()
- subscriptions_page in ./
subscriptions.module - displays subscribed content data on user and subuscription pages @ TODO clean up all of these parts
File
- ./
subscriptions.module, line 1122
Code
function subscriptions_blogs($account = NULL) {
global $user;
if (is_null($account)) {
$account = $user;
}
// query string for blog subscriptions (by blog owner)
$query = 'SELECT u.uid, u.name, s.stype, s.sid FROM ';
$query .= '({subscriptions} s LEFT JOIN {users} u ON u.uid = s.sid) ';
$query .= 'WHERE u.status = 1 AND s.uid = %d AND s.stype = \'blog\'';
$results = db_query($query, $account->uid);
$data = array();
while ($sub = db_fetch_object($results)) {
$data[$sub->uid] = $sub;
}
return drupal_get_form('subscriptions_blogs_form', $data, $account);
}