include_once 'config.php';
include "opendb.php";
$cdate=mktime();
//fakhruddin: for paid and free in MI page
//$findMainNews = "Select nid from content_type_news where field_cont_category_value = 'Main News' order by nid desc LIMIT 3";
$findMainNews = "Select nid from content_type_news order by nid desc LIMIT 3";
$findMainNewsresults = mysql_db_query(DB_NAME_DRUPAL, $findMainNews) or die(mysql_error().__LINE__);
$findMainNewsrowcount = mysql_num_rows($findMainNewsresults);
while($findMainNews = mysql_fetch_assoc($findMainNewsresults))
{
$nid = $findMainNews['nid'];
$selectposting = "Select nid , vid, uid, title, body,teaser,timestamp from node_revisions where nid = '$nid' ";
$selectpostingexe = mysql_db_query(DB_NAME_DRUPAL, $selectposting) or die(mysql_error().__LINE__);
$selectpostingrow = mysql_num_rows($selectpostingexe);
$row = mysql_fetch_assoc($selectpostingexe);
$nid= $row['nid'];
$vid=$row['vid'];
$uid=$row['uid'];
$title=$row['title'];
$body=$row['body'];
$teaser=$row['teaser'];
$date=date("d M , Y",$row['timestamp']);
$finddate = "Select created from node where nid = '$nid'";
$finddateresults = mysql_db_query(DB_NAME_DRUPAL, $finddate) or die(mysql_error().__LINE__);
$finddateresultsrow = mysql_num_rows($finddateresults);
$finddaterow = mysql_fetch_assoc($finddateresults);
$date=date("d M , Y",$finddaterow['created']);
$src = "node/$nid";
$findlink = "Select dst from url_alias where src = '$src' and dst not like '%www%' and dst not like '%http%'";
//echo "findlink".$findlink;
$findlinkresults = mysql_db_query(DB_NAME_DRUPAL, $findlink) or die(mysql_error().__LINE__);
$findlinkresultsrow = mysql_num_rows($findlinkresults);
$findlinkrow = mysql_fetch_assoc($findlinkresults);
$dst= $findlinkrow['dst'];
$lhs_news .="