setQuery($query);
$result = $database->query();
//key-1 means no valid key;
$i=0;
$pageno=1; //zoom starts at page=1
$keyno=-1; //-1 means no key found; zoom starts at key=0
while (($keyno == -1) AND ($row = mysql_fetch_object($result))) {
//echo "
63 :: imgid=$imgid, page=$pageno, keyno=$keyno, i=$i, imgid=$row->imgid
";
if($imgid==$row->imgid){
$keyno = $i;
};
if ($i>=$maxpagesize){
$pageno++; //increase pageno
//$i=0; //resets possible key counter
};
$i++;
};
// handle itmeid;
$itemidurl = $Itemid=='0'?'':'&Itemid='.$Itemid;
// compute href
if ($usepopup == 1){
$this->href = "href=\"javascript:void(0)\" onClick=\"window.open('http://". $_SERVER["HTTP_HOST"] ."components/com_zoom/view.php?popup=1&catid=$catid&PageNo=$pageno&key=$keyno&isAdmin=false&hit=1', 'win1', 'width=650, height=700, scrollbars=1').focus()\"";
$this->href = "href=\"javascript:void(0)\" onClick=\"window.open('http://". $_SERVER["HTTP_HOST"] ."components/com_zoom/view.php?popup=1&catid=$catid&key=$keyno&isAdmin=false&hit=1', 'win1', 'width=650, height=700, scrollbars=1').focus()\"";
} else {
//Rodax Software
if ($catid == 15){
$this->href = "href=\"javascript:void(0)\" onClick=\"window.open('http://". $_SERVER["HTTP_HOST"] ."/components/com_zoom/view.php?popup=1&catid=$catid&PageNo=$pageno&key=$keyno&isAdmin=false&hit=1', 'win1', 'width=850, height=700, scrollbars=1').focus()\"";
$this->href = "href=\"javascript:void(0)\" onClick=\"window.open('http://". $_SERVER["HTTP_HOST"] ."/components/com_zoom/view.php?popup=1&catid=$catid&key=$keyno&isAdmin=false&hit=1', 'win1', 'width=850, height=700, scrollbars=1').focus()\"";
}
else
//Fin Rodax Software
$this->href ="href=\"index.php?option=com_zoom$itemidurl&page=view&catid=$catid&PageNo=$pageno&key=$keyno&hit=1\"";
};
return 'okay';
}
}
} //eo if class already exists
?>