'; $paring = db_query("SELECT n.title, oguid.created, oguid.nid, og.og_description, ctc.field_klubipilt_fid FROM {og_uid} oguid INNER JOIN {node} n ON oguid.nid=n.nid INNER JOIN {content_type_club} ctc ON ctc.nid=oguid.nid INNER JOIN {og} ON og.nid=oguid.nid WHERE oguid.uid=%d AND oguid.is_active=1 ORDER BY oguid.changed DESC LIMIT 2", $user->uid); while($tulemus = db_fetch_object($paring)){ if($tulemus->field_klubipilt_fid==''){ $aadress=''; } else { $paringPilt = db_query("SELECT f.filepath FROM {files} f WHERE f.fid=%d", $tulemus->field_klubipilt_fid); $tulemus2 = db_fetch_object($paringPilt); $aadress=''; } $block_content .= '
'.$aadress.'
'.$tulemus->title.'
'; $kasutajateArvuParing = db_query("SELECT ou.uid FROM {og_uid} ou WHERE ou.nid=%d AND is_active=1", $tulemus->nid); $kasutajateArv = mysql_num_rows($kasutajateArvuParing); $block_content .= 'Lühikirjeldus: '.$tulemus->og_description.'
Liikmeid: '.$kasutajateArv.'
Loodud: '.date('d.m.Y', $tulemus->created).'
'; } $block_content .= '
'; if ($block_content == '
') { $block['subject'] = ''; $block['content'] = ''; return $block; } $block['subject'] = 'Klubid kuhu kuulun'; $block['content'] = $block_content; return $block; } }