$result=db_query("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom <> 0 AND (r.rid IN (:rids) OR r.rid IS NULL) ORDER BY b.weight, b.module",array(':rids'=>$rids));
@@ -44,12 +44,12 @@ function blog_access($op, $node, $account) {
/**
* Implement hook_user_view().
*/
functionblog_user_view(&$edit,&$user,$category){
if(user_access('create blog content',$user)){
$user->content['summary']['blog']=array(
functionblog_user_view($account){
if(user_access('create blog content',$account)){
$account->content['summary']['blog']=array(
'#type'=>'user_profile_item',
'#title'=>t('Blog'),
'#markup'=>l(t('View recent blog entries'),"blog/$user->uid",array('attributes'=>array('title'=>t("Read !username's latest blog entries.",array('!username'=>$user->name))))),
'#markup'=>l(t('View recent blog entries'),"blog/$account->uid",array('attributes'=>array('title'=>t("Read !username's latest blog entries.",array('!username'=>$account->name))))),
'#description'=>t('Allow other users to contact you via a <a href="@url">personal contact form</a> which keeps your e-mail address hidden. Note that some privileged users such as site administrators are still able to contact you even if you choose to disable this feature.',array('@url'=>url("user/$user->uid/contact"))),
'#description'=>t('Allow other users to contact you via a <a href="@url">personal contact form</a> which keeps your e-mail address hidden. Note that some privileged users such as site administrators are still able to contact you even if you choose to disable this feature.',array('@url'=>url("user/$account->uid/contact"))),
drupal_set_message(t('Please configure your <a href="@user-edit">account time zone setting</a>.',array('@user-edit'=>url("user/$user->uid/edit",array('query'=>drupal_get_destination(),'fragment'=>'edit-timezone')))));
drupal_set_message(t('Please configure your <a href="@user-edit">account time zone setting</a>.',array('@user-edit'=>url("user/$account->uid/edit",array('query'=>drupal_get_destination(),'fragment'=>'edit-timezone')))));
drupal_set_message(t('Please configure your <a href="@user-edit">account time zone setting</a>.',array('@user-edit'=>url("user/$user->uid/edit",array('query'=>drupal_get_destination(),'fragment'=>'edit-timezone')))));
}
}
/**
* The user just logged out.
*
* @param $account
* The user object on which the operation was just performed.
*/
functionhook_user_logout($account){
db_insert('logouts')
->fields(array(
'uid'=>$account->uid,
'time'=>time(),
))
->execute();
}
/**
* The user account registration form is about to be displayed.
*
* The module should present the form elements it wishes to inject into the
* form.
*
* @param &$edit
* The array of form values submitted by the user.
* @param $account
* The user object on which the operation is being performed.
* @param $category
* The active category of user information being edited.
* @return
* A $form array containing the form elements to display.