$uid)); } $rolliParing = db_query("SELECT ur.uid FROM {users_roles} ur WHERE ur.rid = 6 AND ur.uid=%d", $uid); $rolliParinguVastus = db_fetch_object($rolliParing); if($uid==$rolliParinguVastus->uid){ $block_content .= '
'; $raamatuIdParing = db_query(("SELECT n.nid, n.uid, n.created FROM {node} n WHERE n.status = 1 AND n.type = 'raamat' AND n.uid = %d ORDER BY n.changed DESC LIMIT 5"), $uid); if(mysql_num_rows($raamatuIdParing)!=0){ $block_content .= ''; } else { $block_content .= 'Raamatud puuduvad.'; } $block_content .= '
'; } // the block view if ($block_content == '') { // no content $block['subject'] = 'Viimased raamatud'; $block['content'] = ''; return $block; } // set up the block $block['subject'] = 'viimased raamatud'; $block['content'] = $block_content; return $block; } }