Czyli robiłem dobrze

Ale niestety, gdy umieszczam taki kod na stronie (z echo) to mam blank page :/
SucharyPod tym linkiem można obejrzeć (chociaż nie wiem co tu jest do oglądania) tą białą stronę
Pełny index wygląda tak:
Kod
<?php foreach($posts as $post):
$urltitle = html_entity_decode(str_replace(array('ą','ć','ę','ł','ń','ó','ś','ź','ż','Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ź','Ż',' '),array('a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z','-'),$post['Post']['title']));
?>
<div class="imagediv">
<h1><?php echo $html->link($post['Post']['title'],'/view/'.$post['Post']['id'].'/'.$urltitle,null,false,false); ?></h1>
Wrzucone <?php echo $time->czas_relatywny($post['Post']['created']); ?> przez <a href="<?php echo $dir; ?>profiles/<?php echo $post['User']['id']; ?>"><?php echo $post['User']['username']; ?></a> | <a href="<?php echo $dir; ?>view/<?php echo $post['Post']['id'].'/'.$urltitle.'#comments'; ?>">Skomentuj (<?php echo $post['Post']['comment_count']; ?>)</a><br />
<span id="vote-<?php echo $post['Post']['id']; ?>">
<?php
if(!isset($post['UserVote'][0])) {
echo 'Głosuj: ';
echo $ajax->link("<b class=\"up\">".$vup."</b>",array('controller'=>'vote','action'=>'up',$post['Post']['id']),array('update'=>'vote-'.$post['Post']['id'], 'before'=>'$(\'vote-'.$post['Post']['id'].'\').innerHTML = \'Twój głos: <img class="load" src="'.$dir.'img/loading.gif" />\';'),null,false);
echo ' · ';
echo $ajax->link("<b class=\"down\">".$vdown."</b>",array('controller'=>'vote','action'=>'down',$post['Post']['id']),array('update'=>'vote-'.$post['Post']['id'], 'before'=>'$(\'vote-'.$post['Post']['id'].'\').innerHTML = \'Twój głos: <img class="load" src="'.$dir.'img/loading.gif" />\';'),null,false);
echo '</span>';
} else {
$post['UserVote'][0]['plus']==1 ? $na=$vup: $na=$vdown;
$na == $vup ? $class = 'up': $class = 'down';
echo "Twój głos: <b class=\"{$class}\">{$na}</b> (".$ajax->link("cofnij",array('controller'=>'vote','action'=>'cancel',$post['Post']['id']),array('update'=>'vote-'.$post['Post']['id'], 'before'=>'$(\'vote-'.$post['Post']['id'].'\').innerHTML += \' <img class="load" src="'.$dir.'img/loading.gif" /> \';'),null,false).")</span>";
}
?> | <?php echo 'Ocena: '.$post['Post']['rate'].' (Liczba głosów: '.$post['Post']['votes_count'].')'; ?><?php
if($session->check('Auth.User')):
?> | <span id="fav-<?php echo $post['Post']['id']; ?>">
<?php
if(isset($post['Favorite'][0])) {
echo $ajax->link("Usuń z ulubionych",array('controller'=>'front','action'=>'del_favorite',$post['Post']['id']),array('update'=>'fav-'.$post['Post']['id'], 'before'=>'$(\'fav-'.$post['Post']['id'].'\').innerHTML += \' <img class="load" src="'.$dir.'img/loading.gif" /> \';'),null,false);
} else {
echo $ajax->link("Do ulubionych",array('controller'=>'front','action'=>'add_favorite',$post['Post']['id']),array('update'=>'fav-'.$post['Post']['id'], 'before'=>'$(\'fav-'.$post['Post']['id'].'\').innerHTML += \' <img class="load" src="'.$dir.'img/loading.gif" /> \';'),null,false);
}
echo '</span>';
endif;
?>
<?php
if($post['Post']['user_id']==$session->read('Auth.User.id') && $post['Post']['public']==0 && ((int)$session->read('Auth.User.admin')===0)) {
echo ' | ';
echo $html->link('Usuń',array('controller'=>'front','action'=>'del',$post['Post']['id']),array('style'=>'color:red;'),'Czy chcesz usunąć?');
}
elseif($session->read('Auth.User.admin')==1) {
echo ' | ';
echo $html->link('Usuń',array('controller'=>'admin','action'=>'delete','post',$post['Post']['id']),array('style'=>'color:red;'),'Czy chcesz usunąć?');
}
?>
<?php
echo "<a href=\"{$dir}view/{$post['Post']['id']}/{$urltitle}\"><img src=\"{$dir}{$post['Post']['img']}\" alt=\"{$post['Post']['title']}\n\n\n{$post['Post']['body']}\" /></a>";
?>
<?php
echo '<div class="fb_share">
<a name="fb_share" type="button_count" share_url="http://'.{$dir}view/{$post['Post']['id']}/{$urltitle}.'" href="http://www.facebook.com/sharer.php" share_url="'.{$dir}view/{$post['Post']['id']}/{$urltitle},'">Share</a>
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>';
?>
<?php
if(!empty($post['Tag'])):
?>
<div class="tags">
Tagi: <?php
foreach($post['Tag'] as $_tag) {
echo $html->link($_tag['name'],array('controller'=>'tag','action'=>$_tag['name']),array('title'=>$_tag['name'])).', ';
}
?>
</div>
<?php endif; ?>
</div>
<?php
if(($ad['i'] % $ad['per']) == 0)
echo $ad['value'];
$ad['i']++;
?>
<?php endforeach; ?>
<div class="paginator">
<?php
$paginator->options(array('url'=>array('controller'=>'/','action'=>'index')));
echo $paginator->prev('«« ',array('class'=>'prev'),null,array('class'=>'disabled'));
echo $paginator->numbers(array('class'=>'numbers'));
echo $paginator->next(' »»',array('class'=>'next'),null,array('class'=>'disabled'));
?>
</div>
<?php /*
pr($posts); */
?>