|
Posted by Fernando Andr on 01/02/05 05:44
Hello, i'm trying to use paginate on a page that will have 2 different
navigation
places.
So I attributed an id to each "target".
The "targets" are in the same template.
The problem:
The links "next" only appears with ?nav=tapetes&=6
there's a variable missing i can't figure out, why.
Here's some code:
the template
"
<td height="30" valign='top' align='center'>
<img src="fotos/tpc.jpg" border="0" alt="Tapetes para Condominios">
<br>
{section name=res loop=$listaCondo}
<a href='?nav=tapetes&id={$listaCondo[res]->idtapete}#tapete'>
<img
src="./includes/resize.php?r=1&img={$listaCondo[res]->imagem}"
border='0' ALT="{$listaCondo[res]->nomeref}">
</a>
<br><br>
{/section}
<span>
{paginate_prev id="condo"} {paginate_next id="condo"}
</span>
</td>
"
the script
"
//Paginação com SmartyPaginate
// required connect
SmartyPaginate::connect("auto");
SmartyPaginate::connect("condo");
//
SmartyPaginate::SetUrl("?nav=tapetes", "auto");
SmartyPaginate::SetUrl("?nav=tapetes", "condo");
//
SmartyPaginate::setUrlVar("auto", "auto");
SmartyPaginate::setUrlVar("condo", "condo");
//Textos
SmartyPaginate::setNextText('Próximo', "auto");
SmartyPaginate::setPrevText('Anterior', "auto");
//
SmartyPaginate::setNextText('Próximo', "condo");
SmartyPaginate::setPrevText('Anterior', "condo");
// set items per page
SmartyPaginate::setLimit(5,"auto");
SmartyPaginate::setLimit(5,"condo");
//
// start Template
//
$Smarty = &new Smarty;
//
// Paging
//
SmartyPaginate::setTotal(count($listaAuto), "auto");
SmartyPaginate::setTotal(count($listaCondo), "condo");
//
// Split content for page
//
if (is_array($listaAuto) && is_array($listaCondo))
{
$listaAuto = array_slice($listaAuto,
SmartyPaginate::getCurrentIndex("auto"), SmartyPaginate::getLimit("auto"));
$listaCondo = array_slice($listaCondo,
SmartyPaginate::getCurrentIndex("condo"),
SmartyPaginate::getLimit("condo"));
}
else
{
$listaAuto = array();
$listaCondo = array();
}
//
// atribute values
//
$Smarty->assign("listaAuto", $listaAuto);
$Smarty->assign("listaCondo", $listaCondo);
//
$Smarty->assign("nomeref", $nomeref);
$Smarty->assign("descr", $descr);
$Smarty->assign("imagem",$imagem);
$Smarty->assign("q", $q);
//
// assign data of paginate to smarty
//
SmartyPaginate::assign($Smarty, 'PagAuto', "auto");
SmartyPaginate::assign($Smarty, 'PagCondo', "condo");
//
// show Template
//
$Smarty->display( THEME . "/tapetes/tapetes.tpl");
"
Thank you for any help.
Best regards,
André
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.7 - Release Date: 30-12-2004
Navigation:
[Reply to this message]
|