';
//$nimi = $puser->profile_eesnimi.' '.$puser->profile_perenimi;
$jalgitavateAutoriteParing = db_query("SELECT ja.autorid, n.uid, n.title FROM {jalgitav_autor} ja INNER JOIN {node} n ON n.type='author' AND ja.autorid=n.nid WHERE ja.userid=%d LIMIT 2", $uid);
while($autoriId = db_fetch_object($jalgitavateAutoriteParing)){
$eesnimeParing = db_query("SELECT value FROM {profile_values} pv WHERE pv.fid=14 AND pv.uid=%d", $autoriId->uid);
$eesnimi = db_fetch_object($eesnimeParing);
$perenimeParing = db_query("SELECT value FROM {profile_values} pv WHERE pv.fid=15 AND pv.uid=%d", $autoriId->uid);
$perenimi = db_fetch_object($perenimeParing);
$nimi = $eesnimi->value.' '.$perenimi->value;
if($autoriId->title==$nimi){
//$block_content .= 'Jälgin seda autorit: '.$nimi.'
'.$autoriId->autorid.'';
$tegevuseParing = db_query("SELECT a.data FROM {activity} a WHERE a.type='comment' AND a.operation='insert' AND uid=%d ORDER BY a.created DESC LIMIT 1", $autoriId->uid);
$pildiParing = db_query("SELECT u.picture FROM {users} u WHERE u.uid=".$autoriId->uid."");
$picture = db_fetch_object($pildiParing);
$picture = $picture->picture;
$eesnimi = $eesnimi->value;
while ($tegevus = db_fetch_object($tegevuseParing)){
preg_match_all('|s:16:\"parent-node-type\";s:(.*):\"(.*)\";|U', $tegevus->data, $tyyp);
preg_match_all('|a:(.*):{s:11:\"comment-cid\";s:2:\"(.*)\"|U', $tegevus->data, $kommentaariId);
$kommentaariParing = db_query("SELECT * FROM {comments} c WHERE c.cid=%d", $kommentaariId[2][0]);
$kommentaar = db_fetch_object($kommentaariParing);
$node = node_load($kommentaar->nid);
$kommnetaariPealkirjaParing = db_query("SELECT * FROM {term_data} td WHERE td.tid=%d", $node->field_raamatu_pealkiri[0]['value']);
$kommentaariPealkiri = db_fetch_object($kommnetaariPealkirjaParing);
if($picture==""){
$piltIse = '
';
} else {
$piltIse = '
';
}
$kommentaarTrim = strip_tags($kommentaar->comment);
$nameLength = strlen($kommentaarTrim);
if($nameLength<=120){
$uusKomm=$kommentaarTrim;
} else {
$uusKomm = substr($kommentaarTrim, 0, 120);
$uusKomm .= '...';
}
if($tyyp[2][0] == 'blog' || $tyyp[2][0] == 'uudis'){
$uudisePealkirjaParing = db_query("SELECT n.title FROM {node} n WHERE n.nid=%d", $kommentaar->nid);
$uudisePealkiri = db_fetch_object($uudisePealkirjaParing);
$block_content .= '
'.date('d.m.Y', $kommentaar->timestamp).'
'.$piltIse.'
';
}
if($tyyp[2][0] == 'raamat'){
$block_content .= '
'.date('d.m.Y', $kommentaar->timestamp).'
'.$piltIse.'
';
}
$block_content .= '
';
}
}
}
$block_content .= '
';
if ($block_content == '