include_once "settings.php"; $pagetitle=""; #navigation settings setvar("st,next,previous"); if(empty($st)){$st=0;} if(empty($next)){$next=0;} if(empty($previous)){$previous=0;} $listnos=15; $maxpages=12; $maxnos=$maxpages*$listnos; if($previous>0){$st=$st-($previous*$listnos);$previous=0;} if($next>0){$st=$st+($next*$listnos);$next=0;} if($st<0){$st=0;} #conditions //$sql="from content where editdt >= (now() - interval 21 day) "; $sql="from content where 1 "; if(!empty($newscategory)){$sql.="and category='$newscategory' ";$pagetitle.=$categories[$newscategory];} if(!empty($newscountry)) { if(!empty($newscategory))$pagetitle.=" - "; $sql.="and country='$newscountry' "; $pagetitle.="Pravasi News From ".$countries[$newscountry]; } elseif(!empty($newscategory))$pagetitle.=" - Pravasi News"; if(isset($othernewslimit)) { $sql.="order by editdt desc "; $sql.="limit $othernewslimit"; $totcnt=$othernewslimit; } else { #get total count $entries=mysqli_query($db,"select count(*) as cnt ".$sql); $tmp=mysqli_fetch_object($entries); $totcnt=$tmp->cnt; if($totcnt>$maxnos)$totcnt=$maxnos; #actual query output $sql.="order by editdt desc "; $sql.=" limit ".$st.",".($listnos+1); } //echo "$totcnt - $sql"; $sql="select cid,header,blur,photothumb,textlink,dt,country,category,homelink,datediff(now(),dt) as daysold ".$sql; $getnews=mysqli_query($db,$sql); $cnt=mysqli_num_rows($getnews); include_once "header.php"; if($newscategory=="FIN" && !isset($othernewslimit)) include "special_finance.php"; //this might decreament $en value ?>