djtozz Posted October 20, 2009 Share Posted October 20, 2009 Hello, I'm having some probs with the page navigation from http://www.filemirrors.info/new The navigation works, but when selecting certain file host or file type the navigation doesn't works properly: Search example: When searching for 'dvdrip' and selecting ONLY avi files http://www.filemirrors.info/new/index.php?q=dvdrip&type=all&tmedia=avi&search=Search I'm getting the right results but the option 'avi' is not saved/included in the navigation. Page 2 displays all mediatypes. // Options selection box select host & type $stype=" AND `fsize`<>''"; if($_GET['stype']=='checked') $stype=" AND `fsize`<>''"; if(!isset($_GET['type']) || $_GET['type']=="all") $fxtype=""; else { if($_GET['type']>=1 && $_GET['type']<=12) $fxtype="AND type='".$_GET['type']."'"; else $fxtype=""; } if(!isset($_GET['tmedia']) || $_GET['tmedia']=="all") $fxmedia=""; else { if($_GET['tmedia']=='avi') $fxmedia="AND media='avi'"; if($_GET['tmedia']=='mp3') $fxmedia="AND media='mp3'"; if($_GET['tmedia']=='rar') $fxmedia="AND media='rar'"; if($_GET['tmedia']=='zip') $fxmedia="AND media='zip'"; } // end options $kwd=mysql_real_escape_string($_GET['q']); $info['keyword']=$kwd; $info['total_results_count']=mysql_get_first_result("SELECT COUNT(*) FROM `v2links` WHERE MATCH (caption) AGAINST ('$kwd')$stype $fxtype"); // navigation if($_GET['start'] && is_numeric($_GET['start'])) { $start=$_GET['start']; $start=((int)($start/$search_count))*$search_count; } else $start=0; $info['curpage']=ceil(($start+1)/$search_count); $info['total_pages']=ceil($info['total_results_count']/$search_count); $navigation=array(); $navigation[]='<span class="navi navi_current"> -'.$info['curpage'].'- </span>'."\n"; $inc=$dec=$start; $tcnt=0; for($i=0;$i<9;$i++) { $inc+=$search_count; $incp=ceil(($inc+1)/$search_count); $dec-=$search_count; $decp=ceil(($dec+1)/$search_count); if($inc<$info['total_results_count']) { array_push($navigation,'<span class="navi"> <a href="./?q='.$_GET['q'].'&start='.$inc.'"&type='.$_GET['type'].'>'.$incp.'</a> </span> '."\n"); $tcnt++; } if($dec>=0) { array_unshift($navigation,'<span class="navi"> <a href="./?q='.$_GET['q'].'&start='.$dec.'">'.$decp.'</a> </span> '."\n"); $tcnt++; } if($tcnt>=10) break; } $navigation=join("",$navigation); // end navigation Can someone advice me how to fix this plaese? Thanks Link to comment https://forums.phpfreaks.com/topic/178395-solved-search-function-navigation-help/ Share on other sites More sharing options...
djtozz Posted November 10, 2009 Author Share Posted November 10, 2009 Sorry... I made a typo while copy/paste.... Code above is working! thanks Link to comment https://forums.phpfreaks.com/topic/178395-solved-search-function-navigation-help/#findComment-954687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.