Thumbnails of Johan Nieuhof’s images of China

"; //echo "
"; //$ppn=$_GET["ppn"]; //echo is_string($ppn); if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) { $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; } else { $ip = $_SERVER['REMOTE_ADDR']; } $return_url=$_SERVER['HTTP_REFERER']; echo "
"; echo "Start page"; echo ""; echo ""; echo "Back"; echo "
"; if(is_string($_GET["ppn"])){ $ppn=(int)$_GET["ppn"]; } if(strpos($_GET["ppn"],"X")>7){ $ppn=$_GET["ppn"]; } $mongo = new MongoClient("mongodb://mdb01.ppl.nl,mdb02.ppl.nl,mdb03.ppl.nl", array( "username" => 'web', "password" => "RhEb992TQFU[L{ZT]YeqBuyWZ", "replicaSet" => "ppl", "connectTimeoutMS" => 1000 )); $db=$mongo->test; $collection=$db->portraits; $limit=20; if($_GET["pg"]){ $page=$_GET["pg"]; } else{ $page=1; } $offset=($page-1) * $limit; $nextpage=($page+1); $prevpage=($page-1); /* echo $offset." "; echo $nextpage." "; echo $prevpage." "; */ $cursor=$collection->find(array('collection'=>'China'))->skip($offset)->limit($limit); $cursor->sort(array('year_of_pub'=>1)); $teller=$cursor->count(); echo "
"; echo ("You clicked for the thumbnails of all images in this collection, we have "); echo $cursor->count(); $tot=$cursor->count()/20; echo " result(s). [about ".round($tot)." pages]
"; echo "Pages: "; for($i=1;$i<(round($tot)+1);$i++){ echo "$i   "; } echo "
"; echo "
Page ".$page; echo ", images: ".($offset+1)."-".($offset+20); echo "
"; if ($page>1){ echo "previous 20 images      "; if(($page*$limit)<$teller){ echo "next 20 images     "; } } else{ if(($page*$limit)<$teller){ echo "next 20 images     "; } } echo "

"; echo "
"; while($result=$cursor->getNext()){ // echo "
"; $z++; $nr=(string)$result["image_nr"]; if(strlen($nr)==1){ $nr="000".$nr; } if(strlen($nr)==2){ $nr="00".$nr; } if(strlen($nr)==3){ $nr="0".$nr; } $ppn=(string)$result["PPN_nr"]; if(strlen($ppn)==8){ $ppn="0".$ppn; } echo "
"; // echo $ppn."_".$nr.".jpg"; echo ""; echo ""; echo ""; echo "

"; echo $result["description"]; echo "
"; echo "
"; // echo "
"; } echo "
"; //echo $z%5; if($z%4==1){ echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; // echo "
"; // echo "
"; } if($z%4==2){ echo "
"; echo "
"; echo "
"; echo "
"; // echo "
"; // echo "
"; } echo "
"; if ($page>1){ echo "previous 20 images      "; if(($page*$limit)<$teller){ echo "next 20 images     "; } } else{ if(($page*$limit)<$teller){ echo "next 20 images     "; } } echo "
"; $tijd=time(); $plaatje=$ppn."_".$nr; $gebruik=array('url'=>$return_url,'tijd'=>$tijd,'ip'=>$ip,'script'=>'all_thumbs_search'); json_encode($gebruik); $collection_clicked=$db->engravings_use; $collection_clicked->insert($gebruik); $mongo->close(); echo "
"; echo "
"; ?>