$uid));
$telli = $puser->profile_telliuudised;
}
if($telli==1){
$address = $_SERVER['SERVER_NAME'];
$block_content .= '
';
$uudiseParing = db_query("SELECT n.title, n.created, n.nid FROM {node} n WHERE n.type = 'uudis' AND n.status='1' ORDER BY created DESC LIMIT %d", 3);
$block_content .= '
Viimased uudised';
while ($uudis = db_fetch_object($uudiseParing)){
$nameAlone = $uudis->title;
$nameLength = strlen($nameAlone);
if($nameLength<=25){
$newName=$nameAlone;
} else {
$newName = substr($nameAlone, 0, 25);
$newName .= '...';
}
$block_content .= '
[ '.date('d.m.Y', $uudis->created).' ]
';
}
$block_content .= '
';
}
if ($block_content == '') {
$block['subject'] = '';
$block['content'] = '';
return $block;
}
$block['subject'] = '';
$block['content'] = $block_content;
return $block;
}
}