ja przerobiłem prosty przykład, nie znam Twojego kodu ale może coś ci to pomoże:
kawałek klasy (model)
<?php
public function showAll($str = NULL) {
if ($str == NULL) {
$limit1 = 0;
$limit2 = $this->limit;
} else {
$limit1 = $this->limit * $str - $this->limit;
$limit2 = $this->limit * $str;
}
$this->conn->query("SELECT * FROM ".db_prefix."pliki LIMIT $limit1,$limit2");
$i=0;
while($row=$this->conn->fetchArray()) {
$this->all_files[$i]['id']=$row['id'];
$this->all_files[$i]['kategoria']=$row['kategoria'];
$this->all_files[$i]['nazwa']=$row['nazwa'];
$this->all_files[$i]['link']=$row['link'];
$this->all_files[$i]['thumb']=$row['thumb'];
$this->all_files[$i]['rozmiar']=number_format($row['rozmiar']/1024
, 2
); $this->all_files[$i]['data_dodania']=$row['data_dodania'];
$this->all_files[$i]['dodal']=$row['dodal'];
$i++;
}
return $this->all_files;
}
public function _showAll() {
$ile = $this->conn->selectValue("count(*)","pliki");
$this->liczba_stron = $ile / $this->limit;
$this->liczba_stron = ceil($this->liczba_stron); for($a = 1; $a <= $this->liczba_stron; $a++) {
if ($this->liczba_stron == 1) {
$dupa[] = 1;
} else {
$dupa[] = '<a href="admin.php?cms_id=6&str='.$a.'"><span class="menublad">'.$a.'</span></a>';
}
}
return $dupa;;
}
?>
fragment pliku php (kontroler)
<?php
$smarty->assign('all_images',$upload->showAll($_GET['str']));
$smarty->assign('v',$upload->_showAll());
$smarty->display('admin_files_1.tpl');
?>
fragment pliku admin_files_1.tpl (widok)
<?php
<td align=left colspan=6>
<span class="menufont1">Strony:
{foreach from=$v item=st}
{$st},
{/foreach}
</span>
</td>
?>
nie jest to mistrzostwo świata, ale na moje potrzeby wystarcza. Może ten kod naprowadzi cię na rozwiązanie problemu. Pozdr