Query($sql); $row = $db->FetchResult($db->result); $nbsmiley = $row['NB']; $template->assign(array("categorie" => $_GET['directory'], "pageencours" => ($pageencours+1), "nbsmiley" => (int)$nbsmiley)); $sql = "SELECT a.*, b.CATEGORIE_".intval(IDLANGUAGE)." AS CATEGORIE, c.PARENT_".intval(IDLANGUAGE)." AS PARENT FROM SMILEY a INNER JOIN CATEGORIE_NEW b ON a.IDCATEGORIE=b.IDCATEGORIE INNER JOIN PARENT c ON b.IDPARENT=c.IDPARENT WHERE b.IDCATEGORIE='".intval($idcategorie)."' ORDER BY a.LARGEUR DESC, a.HAUTEUR DESC LIMIT $debut, $nb"; $db->Query($sql); $i = 1; while($row = $db->FetchResult($db->result)){ $categorie = $row['CATEGORIE']; $parent = $row['PARENT']; if($row['LARGEUR']>$limit){ $img_width = $limit; $img_height = ''; } else{ $img_width = (int)$row['LARGEUR']; $img_height = (int)$row['HAUTEUR']; } $template->assign(array("link" => URL_SITE.'free-smiley-'.(int)$row['IDSMILEY'].'-'.clean($row['CATEGORIE']).'.htm', "img_link" => URL.'smiley/'.$row['SMILEY'], "img_width" => $img_width, "img_height" => $img_height, "img_name" => $row['CATEGORIE'], "img_id" => (int)$row['IDSMILEY'])); $template->parse('body.line.column'); if($i%$nbcolonne==0){ $template->parse('body.line'); } $i++; } if($i%$nbcolonne!=1){ $template->parse('body.line'); } /* */ $totalpage = (int)($nbsmiley/$nb); if($nbsmiley%$nb!=0) $totalpage++; $pageencours = (int)$_GET["page"]; $nbpage = (int)($nbsmiley/$nb); $limitpage = 10; $limitmoitie = (int)$limitpage/2; if($nbpage>$limitpage){ if($pageencours+1>=$limitpage){ $tmp = $pageencours+$limitmoitie; if($tmp<$nbpage){ $fin = $tmp; } else{ $fin = $nbpage; } } else{ $fin = $limitpage; } $debut = $fin - $limitpage; } else{ $debut = 0; $fin = $nbpage; } //---- if($pageencours>0){ $link = 'smiley-'.($pageencours-1).'-'.clean($categorie).'.htm'; $template->assign(array("page_nb" => "Précédent", "page_title" => "", "page_link" => $link, "page_grand" => "")); $template->parse("body.page"); } //-----// for($i=$debut;$i<=$fin;$i++){ $tmp = $meta_title; $tmp .= ($i>0)?" - page ".($i+1):""; $template->assign(array("page_link" => 'smiley-'.$i.'-'.clean($categorie).'.htm', "page_nb" => ($i+1), "page_grand" => ($i==$_GET['page'])?"page_grand":"sidelink", "page_title" => $tmp, "page_id" => $i)); $template->parse('body.page'); } //---- if($pageencours<$nbpage && $nbpage>1){ $link = 'smiley-'.($pageencours+1).'-'.clean($categorie).'.htm'; $template->assign(array("page_nb" => "Suivant", "page_title" => "", "page_link" => $link, "page_grand" => "")); $template->parse("body.page"); } //-----// $template->assign(array("categorie" => ucfirst(strtolower($categorie)), "link_pack" => URL_SITE.'download-smiley-'.(int)$idcategorie.'-'.clean($categorie).'.htm')); $meta_title = "Smileys gratuits ".$parent." > ".$categorie." sur Best Emoticon - page ".($_GET['page']+1).""; $meta_description = "Smileys gratuits ".$parent." > ".$categorie.","; include "common/footer.php"; ?>