1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| ///pagination
$catid=$_GET["catid"];
echo "<div class='sectiontableentry15'><table><tr>";
echo '<td width="";>';
$min=1;
$max=18;
$pre=mysql_query(" SELECT count( `id` ) FROM `jos_datsogallery` WHERE `catid` =".$catid." and `published` ='1' ");
$tot=mysql_result($pre,0,0);
//echo $total;
$nombre=$tot/18;
//echo $nombre;
echo "Pages : ";
for($i=1;$i<$nombre+1;$i++)
{
if(($min<=$total)&&($total<=$max))
{
echo $i=$nombre.' ';
}
else
{
echo $i.' ';
$min=$min+$max;
$max=$max+18;
}
}
echo '</td></tr>';
// tableau de miniatures
$catid=$_GET["catid"];
$id_photo=$_GET["id"];
$query="SELECT * FROM `jos_datsogallery` WHERE `published` ='1' AND `catid` =".$catid." ORDER BY `ordering` limit 0,18";
$result=mysql_query($query);
$i=0;
$max=3;
while($val=mysql_fetch_array($result))
{
$nom=$val['imgthumbname'];
$titre=$val['imgtitle'];
$num=$val['id'];
if($i>0 && $i%3==0)
{
echo '</tr><tr>';
}
echo '<td>';
echo "<a href=\"index.php?option=com_datsogallery&Itemid=27&func=detail&catid=".$catid."&id=".$num."\"><img src=components/com_datsogallery/img_thumbnails/$nom alt=$nom title=$titre border='0'/></a>";
echo '</td>';
$i++;
}
echo '</tr>';
echo'</table></div>'; |
Partager