Jump to content

Pagination?


ueon

Recommended Posts

Does anyone know how to paginate the following code? you can see what it does so far on http://sunient.ca/charmsky/mjackets.php?page=1

 

<?php
$total = 50;
$count_thumb = 1;
$count_group = 1;
$div_top = 80;
$div_left = 25;
$max = 12;
$totalpages = $total / $max;


$page = $_GET['page'];

if(empty($page) || $page == 0)
{
	$count_thumb = 1;
	$count_group = 1;
}

if ($page != 1 || $page != 0)
{
	$count_thumb = (($page - 1) * 20) + 1;
	$count_group = (($page - 1) * 20) + 1;
}

//positions the thumbnails
while ($count_thumb <= $total)
{
	echo "<div style='position: absolute; top: ".$div_top."px; left: ".$div_left."px;'>\n";
	echo "<a href='products/men/jackets/detail/".$count_thumb."/1.jpg' rel='lightbox[".$count_thumb."]'><img src='products/men/jackets/thumb/".$count_thumb.".jpg' border='0' \></a>\n";	
	echo "</div>\n";

	$div_left = $div_left + 150;
	if ($div_left == 625)
	{
		$div_left = $div_left - 600;
		$div_top = $div_top + 200;
		echo "<BR \>\n";
	}

	$count_thumb++;
}

while ($count_group <= $total) 
{	
	$file_count = 2;

	while ($file_count <= 3)
	{
		echo "<a href='products/men/jackets/detail/".$count_group."/".$file_count.".jpg' rel='lightbox[".$count_group."]'></a>\n";
		$file_count++;
	}

	$count_group++;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/149569-pagination/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.