All pastes #514459 Raw Edit

Mine

public text v1 · immutable
#514459 ·published 2007-05-27 19:15 UTC
rendered paste body
<?php


function displaythumbnails()
{
	global $thumbcolumns;
	global $thumbrows;
	global $lastimagevalue;
	global $thumbborder;
	global $thumbpadding;
	global $maxthumbdimension;

	$pages = ceil($lastimagevalue / ($thumbrows * $thumbcolumns));
	$currentpage = 1;
	if(($_GET[page] > 1) && ($_GET[page] <= $pages)) { $currentpage = $_GET[page];} // validates page= info

	$currentimage = 1;
	if($currentpage > 1) { 
		$currentimage = (($thumbrows * $thumbcolumns * ($currentpage -1))+1);  // finds start image for given page.
		echo '<a href="' . pageurl($currentpage-1) . '">Previous</a> ' ;
	}
	else{ echo 'Previous ' ;}
	if($currentpage < $pages){echo '<a href="' . pageurl($currentpage+1) . '">Next</a>';}
	else{ echo 'Next';}

}

function displaythubmbnails()
{
	global $thumbcolumns, $thumbrows, $lastimagevalue, $thumbborder, $thumbpadding, $maxthumbdimension;
	
	$pages = ceil($lastimagevalue / ($thumbrows * $thumbcolumns));
	if ( is_numeric($_GET['page']) && $_GET['page'] > 1  && $_GET['page'] <= $pages )
		$currentpage = $_GET['page'];
	else 
		$currentpage = 1;
		
		if ( $currentpage > 1 )
		{
			$currentimage = (($thumbrows * $thumbcolumns * ($currentpage - 1)) + 1 );
			echo "<a href=\"". pageurl($currentpage-1) ."\">Next</a>";
		}
		else 
			echo "Previous";
		
		if ( $currentpage < $pages ) 
			echo ....
		else....
		
	
	/* or..

	if ( is_numeric($_GET['page']) && $_GET['page'] > 1  && $_GET['page'] <= $pages) )
	{
		$currentpage = $_GET['page'];
	}
	else
	{
	...
	}
	*/
}