$ile) $stop=$ile; if($ile>$results){ $tempnr=ceil($ile/$results); $tempnr_stop=$page_nr+5; $tempnr_start=$page_nr-5; if($tempnr_stop>$tempnr) $tempnr_stop=$tempnr+1; if($tempnr_start<1) $tempnr_start=1; $pages="   "; if($page_nr>1 and $page_nr_prev==1) $pages=$pages."       "; if($page_nr>1 and $page_nr_prev!=1) $pages=$pages."       "; for($i=$tempnr_start;$i<$tempnr_stop;$i++){ if($i==$page_nr) $pages=$pages." $i "; else {if($i==1) $pages=$pages." [$i] "; else $pages=$pages." [$i] "; } } if($page_nr<$tempnr) $pages=$pages."       "; $pages=$pages."     "; $pages=" Browse Pages: ".$pages; } $catprograms=""; $tr=0; $k=$start1; if($order==0) { //$result = mysql_query("SELECT id,id_1,name,version,shortdescription,license,cost,size,icon,downloadurl1,pdate,linkbackurl,link FROM `final` where (categoryprim_nr='$categoryprim_nr' and categorysec_nr='$categorysec_nr') order by downloads DESC limit $start,$results", $link_id); $result = mysql_query("SELECT a.id, id_1, a.name, version, shortdescription, license, cost, size, icon, downloadurl1, b.pdate, linkbackurl, link FROM `final_browse_categories_order_by_downloads` a JOIN final b ON a.id = b.id WHERE (a.categoryprim_nr='$categoryprim_nr' and a.categorysec_nr='$categorysec_nr') and a.orderby_id_sec>$start and a.orderby_id_sec<=$start+$results", $link_id); $page_title="Browse $categorysec - $categoryprim : $start1-$stop programs listed after popularity"; } else if($order==1) { //$result = mysql_query("SELECT id,id_1,name,version,shortdescription,license,cost,size,icon,downloadurl1,pdate,linkbackurl,link FROM `final` where (categoryprim_nr='$categoryprim_nr' and categorysec_nr='$categorysec_nr') order by name asc limit $start,$results", $link_id); $result = mysql_query("SELECT a.id, id_1, a.name, version, shortdescription, license, cost, size, icon, downloadurl1, b.pdate, linkbackurl, link FROM `final_browse_categories_order_by_Program_Name` a JOIN final b ON a.id = b.id WHERE (a.categoryprim_nr='$categoryprim_nr' and a.categorysec_nr='$categorysec_nr') and a.orderby_id_sec>$start and a.orderby_id_sec<=$start+$results", $link_id); $page_title="Browse $categorysec - $categoryprim : $start1-$stop programs listed after title"; } else if($order==2) { //$result = mysql_query("SELECT id,id_1,name,version,shortdescription,license,cost,size,icon,downloadurl1,pdate,linkbackurl,link FROM `final` where (categoryprim_nr='$categoryprim_nr' and categorysec_nr='$categorysec_nr') order by pdate DESC limit $start,$results", $link_id); $result = mysql_query("SELECT a.id, id_1, a.name, version, shortdescription, license, cost, size, icon, downloadurl1, b.pdate, linkbackurl, link FROM `final_browse_categories_order_by_pdate_DESC` a JOIN final b ON a.id = b.id WHERE (a.categoryprim_nr='$categoryprim_nr' and a.categorysec_nr='$categorysec_nr') and a.orderby_id_sec>$start and a.orderby_id_sec<=$start+$results", $link_id); $page_title="Browse $categorysec - $categoryprim : $start1-$stop newest programs"; } else { //$result = mysql_query("SELECT id,id_1,name,version,shortdescription,license,cost,size,icon,downloadurl1,pdate,linkbackurl,link FROM `final` where (categoryprim_nr='$categoryprim_nr' and categorysec_nr='$categorysec_nr') order by pdate ASC limit $start,$results", $link_id); $result = mysql_query("SELECT a.id, id_1, a.name, version, shortdescription, license, cost, size, icon, downloadurl1, b.pdate, linkbackurl, link FROM `final_browse_categories_order_by_pdate_ASC` a JOIN final b ON a.id = b.id WHERE (a.categoryprim_nr='$categoryprim_nr' and a.categorysec_nr='$categorysec_nr') and a.orderby_id_sec>$start and a.orderby_id_sec<=$start+$results", $link_id); $page_title="Browse $categorysec - $categoryprim : $start1-$stop oldest programs"; } //$page_title="Browse $categorysec - $categoryprim Programs"; $order_type=" Display by: Popularity | Title | Newest | Oldest"; $bgc=1; $ad=1; while ($row = mysql_fetch_row($result)) { $id=$row[0]; $id_1=$row[1]; $name=stripslashes($row[2]); $version=$row[3]; $title=stripslashes($row[4]); $license=$row[5]; $cost=$row[6]; $size=$row[7]; $icon=$row[8]; $download=$row[9]; $pdate=$row[10]; $linkbackurl=$row[11]; $link=$row[12]; $name_1=eregi_replace(" ","_",$name); if($bgc==1) $sectiontableentry='sectiontableentry1'; else $sectiontableentry='sectiontableentry2'; $bgc++; if($bgc==3) $bgc=1; if($linkbackurl!='') {$class=" class=\"redtitle\""; $list_title="$name $version"; } else { $class=" class=\"category\""; $list_title="$name $version"; } $catprograms=$catprograms." \"$name\"  $k)   $list_title
$title
"; $k++; $ad++; } mysql_close($link_id); ?> <? echo("$page_title"); ?>