<?php
ob_start();
include_once("includes/application.php");

$cond4="";
	if(!empty($_REQUEST['mod_option'])){
	$menuclass=1;
	if(!empty($_GET['id'])){
	$Dbh1 = $db->query("SELECT id,name,metatitle,metakeywords,pagedescription  FROM category WHERE id='".$_REQUEST['id']."' and status=1 ");
	$row_act1=$db->fetchArray($Dbh1);
	$crow_cat1=$db->numRows($Dbh1);
	
	if($crow_cat1>0){
		$page_title=$row_act1['metatitle'];
		$meta_keywords=$row_act1['metakeywords'];
		$page_desc=$row_act1['pagedescription'];
		}
	}
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	
	if($_REQUEST['mod_option']=="list"){
	$menuclass=2;
	if($_SERVER['REQUEST_METHOD']=="POST"){
	$q=$db->fetchArray($db->Query("select id,name,category from profile where name like '%".$_POST['country']."%'"));
	echo "<script>window.location.href='".$siteurl."id".$q['category']."-pid".$q['id']."-ch".substr($q['category'],0,1)."/profile/".SafeURL($q['name'])."'</script>";
	}
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/list.php";
	}
	
	if($_REQUEST['mod_option']=="listblog"){
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/list_blog.php";
	}
	
	if($_REQUEST['mod_option']=="blogs"){
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/blog_index.php";
	}
	
	if($_REQUEST['mod_option']=="movie"){
	$menuclass=3;
	$date_sel=date("Y-m-d");
	if(!empty($_GET['rid']))
	{
	$cond4=" and id='".$_GET['rid']."'";
	}
	
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	$reccond="";
	
	/*if(!empty($_REQUEST['month'])){
	$day=date("d");
	if(!empty($_GET['h']) && !empty($_GET['m']) && !empty($_GET['y'])  ){
	$date=$_GET['y']."-".$_GET['m']."-".$_GET['h'];
	}
	else if(!empty($_GET['m'])){
	 $date=date("Y")."-".$_GET['m']."-".date("d");;
	}
	else{
	 $date=$_REQUEST['year']."-".$_REQUEST['month']."-".$day;
	}
	
	}
	
	else if(!empty($_GET['m'])){
	
	 $date=date("y")."-".$_GET['m']."-".date("d");;
	}*/
	//main part dont change 
	//echo "select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles, source,movies,news_on from content where news_on='".$date."' and status=1 ".$cond4."";
	if(!empty($_GET['m'])  && empty($_GET['d']) && empty($_GET['y'])){
	$date="";
	
	$reccond=" month(news_on)='".$_GET['m']."'";
	/*$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where month(news_on)='".$_GET['m']."'  and concat(',',movies,',')  like '%,".$_GET['id'].",%' and  status=1 ".$cond4."");
	*/
	}
	else if(!empty($_GET['m'])  && empty($_GET['d']) && !empty($_GET['y'])){
	$date="";
	$reccond=" month(news_on)='".$_GET['m']."' and  year(news_on)='".$_GET['y']."'";
	
	/*$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where month(news_on)='".$_GET['m']."' and  year(news_on)='".$_GET['y']."'   and concat(',',movies,',')  like '%,".$_GET['id'].",%' and  status=1 ".$cond4."");
	*/
	}
	else if(!empty($_GET['m'])  && !empty($_GET['d']) && !empty($_GET['y'])){
	$date=$_GET['y']."-".$_GET['m']."-".$_GET['d'];
	$reccond=" month(news_on)='".$_GET['m']."' and  year(news_on)='".$_GET['y']."' and day(news_on)= '".$_GET['d']."'";
	
	/*$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles, source,movies,news_on from content where month(news_on)='".$_GET['m']."' and  year(news_on)='".$_GET['y']."'   and concat(',',movies,',')  like '%,".$_GET['id'].",%' and  status=1 ".$cond4."");*/
	
	}
	else{
	$day=date("d");$year=date("Y");$month=date("m");
	$reccond="  month(news_on)='".$month."' and  year(news_on)='".$year."' and day(news_on)= '".$day."'";
	}
	
	
	$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where ".$reccond."  and concat(',',movies,',')  like '%,".$_GET['id'].",%'  and  status=1 ".$cond4."");
	}
	else{
	
	if(!empty($_GET['y']) && !empty($_GET['d']) && !empty($_GET['m'])){
	$day=date("d");/*if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ echo $d=$_GET['h']; }*/
	$date=$_GET['y']."-".$_GET['m']."-".$_GET['d'];
	
	}
	else if(!empty($_GET['m'])){
	$day=date("d");/*if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ echo $d=$_GET['h']; }*/
	 $date=date("Y")."-".$_GET['m']."-".$day;
	$date="";
	}
	else{
	if(!empty($_GET['h'])){$year=date("Y");
	$month=date("m");
	/*$day=date("d");if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ $d=$_GET['h']; }*/
	if($_GET['d']<10){
	$day="0".$_GET['d'];
	}
	else{
	$day=$_GET['d'];
	}
	 $date=$year."-".$month."-".$day;
	
	}
	else{
	$year=date("Y");
	$month=date("m");$day=date("d");
	}
	}
	$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where news_on='".$date."'   and concat(',',movies,',')  like '%,".$_GET['id'].",%' and  status=1 ".$cond4."");
	}
	$content_data1=$db->fetchArray($db->Query("select * from category where id='".$_GET['id']."'  and status=1"));
	$page_title=$content_data1['metatitle'];
	$meta_keywords=$content_data1['metakeywords'];
	$page_desc=$content_data1['pagedescription'];
	
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/movie_news.php";
	}
	if($_REQUEST['mod_option']=="profile"){
	
	$pro_data=$db->Query("select * from profile where id='".$_REQUEST['pid']."'");
	$row_pro=$db->fetchArray($pro_data);
	$page_title=$row_pro['metatitle'];
	$meta_keywords=$row_pro['metakeywords'];
	$page_desc=$row_pro['pagetitle'];
	//$meta_title=$row_pro['metatitle'];
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/profile.php";
	}
	if($_REQUEST['mod_option']=="news"){
	$menuclass=3;
	$date_sel=date("Y-m-d");
	/*if(!empty($_GET['rid']))
	{
	$cond4=" and id='".$_GET['rid']."'";
	}*/
	
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	if(!empty($_REQUEST['month'])){
	$day=date("d");
	if(!empty($_GET['d']) && !empty($_GET['m']) && !empty($_GET['y'])  ){
	$date=$_GET['y']."-".$_GET['m']."-".$_GET['d'];
	}
	else{
	 $date=$_REQUEST['year']."-".$_REQUEST['month']."-".$day;
	}
	
	}
	
	else if(!empty($_GET['d']) && !empty($_GET['m']) && !empty($_GET['y'])  ){
	
	 $date=$_GET['y']."-".$_GET['m']."-".$_GET['d'];
	}
	else{
	$day=date("d");$year=date("Y");$month=date("m");
	 $date=$year."-".$month."-".$day;
	
	}
	//echo "select * from content where news_on='".$date."' and status=1 ".$cond4."";
	if(!empty($_GET['m'])  && empty($_GET['d']) && empty($_GET['y'])){
	$date="";
	$news_data=$db->Query("select * from content where month(news_on)='".$_GET['m']."'  and concat(',',profiles,',')  like '%,".$_GET['rid'].",%' and  status=1 ".$cond4."");
	}
	else if(!empty($_GET['m'])  && empty($_GET['d']) && !empty($_GET['y'])){
	$date="";
	$news_data=$db->Query("select * from content where month(news_on)='".$_GET['m']."' and  year(news_on)='".$_GET['y']."'   and concat(',',profiles,',')  like '%,".$_GET['rid'].",%' and  status=1 ".$cond4."");
	}
	else{
	
	$news_data=$db->Query("select * from content where news_on='".$date."'  and concat(',',profiles,',')  like '%,".$_GET['rid'].",%'  and  status=1 ".$cond4."");
	
	}
	
	}
	else{
	if(!empty($_GET['y']) && !empty($_GET['d']) && !empty($_GET['m'])){
	$day=date("d");/*if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ echo $d=$_GET['h']; }*/
	$date=$_GET['y']."-".$_GET['m']."-".$_GET['d'];
	
	}
	else{
	if(!empty($_GET['d'])){$year=date("Y");
	$month=date("m");
	/*$day=date("d");if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ $d=$_GET['h']; }*/
	if($_GET['d']<10){
	$day="0".$_GET['d'];
	}
	else{
	$day=$_GET['d'];
	}
	$date=$year."-".$month."-".$day;
	
	}
	else{
	$year=date("Y");
	$month=date("m");$day=date("d");
	$date=$year."-".$month."-".$day;
	}
	$news_data=$db->Query("select * from content where news_on='".$date."'   and concat(',',profiles,',')  like '%,".$_GET['rid'].",%' and  status=1 ".$cond4."");
	}}
	$content_data1=$db->fetchArray($db->Query("select * from category where id='".$_GET['id']."'  and status=1"));
	$page_title=$content_data1['metatitle'];
	$meta_keywords=$content_data1['metakeywords'];
	$page_desc=$content_data1['pagedescription'];
	
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/news.php";
	}
	
	if($_REQUEST['mod_option']=="subscribe"){
	$date_sel=date("Y-m-d");
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	if(!empty($_POST['sub']))
	{
	
	$cat=getIdName("category","name","type='CAT1' and status=1 and id=".$_POST['cat']);
	$scat=getIdName('profile','name',"id='".$_POST['scat']."' and status=1");
	
	$body="<style type='text/css'>
	<!--
	.text-black{font-size:14px; font-family:Arial, Helvetica, sans-serif ;font-weight:bold; color:#000000}
	.text-org{font-size:12px;  font-family:Arial, Helvetica, sans-serif ;font-weight:bold; color:#80AF30}
	.name
	{
	color:#FF6600;
	font-family: Arial, Helvetica, sans-serif;
	font-size:14px; 
	font-weight:bold;
	}
	.subscribe_link:link{font-size:12px; font-weight:bold; font-family: Arial, Helvetica, sans-serif;color:#0F4789; text-decoration:underline}
	.subscribe_link:visited{font-size:12px; font-weight:bold;font-family: Arial, Helvetica, sans-serif; color:#0F4789;text-decoration:underline}
	.subscribe_link:hover{font-size:12px; font-weight:bold;font-family: Arial, Helvetica, sans-serif;color:#0F4789;text-decoration:underline}
	.subscribe_link:active{font-size:12px; font-weight:bold;font-family: Arial, Helvetica, sans-serif;color:#0F4789;text-decoration:none}.mail-link:link{font-family:Arial, Helvetica, sans-serif ;font-size:12; color:#80AF30; font-weight:bold; text-decoration:none;}
	-->
	</style>
	<table width='780' border='0' align='center' cellpadding='3' cellspacing='0'>
	<tr>
	<td height='20'>&nbsp;</td>
	</tr>
	<tr>
	<td align='left' class='text-black'>Hi ,</td>
	</tr>
	<tr>
	<td height='20'>I'm ".$_POST['uname']."</td>
	</tr>
	<tr>
	<td align='left' >I Subscribed to <span class='text-black'>".$scat." </span>  under <span class='text-black'>".$cat." </span> Category</td>
	</tr>
	<tr>
	<td height='20' align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
	</tr>
	<td class='text-blue'>&nbsp;</td>
	</tr>
	</table>";
	//echo $body;exit;
	$from=$_POST['email'];
	//$to=$_POST['fname']; 
	//$mailto = "info@telugucolours.com"; 
	$mailto = "info@telugucolours.com"; 
	
	$name=$_POST['uname'];
	//print_r($_POST);exit;
	tc_mail($name,$mailto,$body,"Subscribed Details from ".$_POST['uname']."");
	$db->Query("insert into subscribers(`id`,`name`,`email`,`phone`,`category`,`profile`,`status`,`dateadded`)
	values('','".$_POST['uname']."','".$_POST['email']."','".$_POST['phone']."','".$_POST['cat']."','".$_POST['scat']."',0,now())");
	header("location:".$siteurl."msgsucc/g-subscribe/subscribe-for-newsletters");
	}		
	}
	
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/subscribe.php";
	}
	if($_REQUEST['mod_option']=="feedback"){
	
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/feedback.php";
	}
	if($_REQUEST['mod_option']=="contact"){
	$menuclass=1;
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	$ser="";
	
	if(!empty($_POST['searchen']) && $_POST['searchen']=="Enter Search Engine")
	{
	$ser="";
	}
	else{
	$ser=$_POST['searchen'];
	
	}
	$db->Query("insert into contactus(`id`,`name`,`email`,`country`,`state`,`city`,`requirements`,`searchengine`,`status`,`dateadded`)
	values('','".$_POST['uname']."','".$_POST['email']."','".$_POST['country']."','".$_POST['state']."','".$_POST['city']."','".$_POST['requirements']."','".$ser."',0,now())");
	
	if(!empty($_POST['feedback1']))
	{
	$mailbody="<table width='75%' border='0' align='center' cellpadding='4' cellspacing='0'>
	<tr>
	<td align='right'>&nbsp;</td>
	<td align='center'>&nbsp;</td>
	<td>&nbsp;</td>
	</tr>
	<tr>
	<td align='right'>&nbsp;</td>
	<td align='center'>&nbsp;</td>
	<td>&nbsp;</td>
	</tr>
	<tr>
	<td width='44%' align='right'><strong>Name</strong></td>
	<td width='3%' align='center'>:</td>
	<td width='53%'>".$_POST['uname']."</td>
	</tr>
	<tr>
	<td align='right'><strong>E-Mail Id </strong></td>
	<td  align='center'>:</td>
	<td>".$_POST['email']."</td>
	</tr>
	<tr>
	<td align='right'><strong>Country</strong></td>
	<td  align='center'>:</td>
	<td>".$_POST['country']."</td>
	</tr>
	<tr>
	<td align='right'><strong>State</strong></td>
	<td  align='center'>:</td>
	<td>".$_POST['state']."</td>
	</tr>
	<tr>
	<td align='right'><strong>City</strong></td>
	<td  align='center'>:</td>
	<td>".$_POST['city']."</td>
	</tr>
	<tr>
	<td height='20' colspan='3'><strong>Requirements</strong>:</td>
	</tr>
	<tr>
	<td colspan='3'>".$_POST['requirements']."</td>
	</tr>";
	if(!empty($_POST['searchen']) && $_POST['searchen']!='Enter Search Engine'){
	$mailbody.="
	<tr>
	<td align='right'><strong>I Found in Search Engine</strong></td>
	<td  align='center'>:</td>
	<td>".$_POST['searchen']."</td>
	</tr>";}
	$mailbody.=" <tr>
	<td align='right'>&nbsp;</td>
	<td  align='center'>&nbsp;</td>
	<td>&nbsp;</td>
	</tr>
	</table>
	";
	
	$from=$_POST['email'];
	$mailto = "info@telugucolours.com"; 
	$mailto1 = "trsl@bitragroup.com"; 
	$name=$_POST['uname'];
	$subject="Contact Details from ".$_POST['uname']."";
	//tc_mail($name,$mailto,$from,$body,"Feedback Details from ".$_POST['uname']."");
	/*$mailheader  = 'MIME-Version: 1.0' . "\r\n";
	$mailheader .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
	$mailheader.='From:admin@telugucolours.com'. "\r\n";*/
	
	tc_mail($name,$mailto,$mailbody,$subject);
	header("location:".$siteurl."msgt/g-contact/contact-us");
	}		
	}
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/contactus.php";
	}
	
	if($_REQUEST['mod_option']=="content"){
	$dis=$db->fetchArray($db->Query("select * from cms where code='".$_GET['cat']."'"));
	$page_title=$dis['pagetitle'];
	$meta_keywords=$dis['keywords'];
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/content.php";
	}
	
	if($_REQUEST['mod_option']=="gallery"){
	$dis=$db->fetchArray($db->Query("select * from galleryimages where 1 group by title" ));
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/gallery_index.php";
	}
	
	if($_REQUEST['mod_option']=="viewgallery"){
	$menuclass=6;
	$dis=$db->fetchArray($db->Query("select * from galleryimages where 1 group by title" ));
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/gallery.php";
	}
	
	if($_REQUEST['mod_option']=="viewphotos"){
	$menuclass=6;
	$dis=$db->fetchArray($db->Query("select * from galleryimages where 1 group by title" ));
	if(!empty($_GET['viewid'])){
	$Dbh1 = $db->query("SELECT id,metatitle,metakeywords,pagedescription,name  FROM gallery WHERE id='".$_REQUEST['viewid']."' and status=1 ");
	$row_act1=$db->fetchArray($Dbh1);
	$crow_cat1=$db->numRows($Dbh1);
	if($crow_cat1>0)
	{
	$page_title=$row_act1['name'];
	$meta_keywords=$row_act1['metakeywords'];
	$page_desc=$row_act1['pagedescription'];
	}
	}
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/view_photos.php";
	}
	
	if($_REQUEST['mod_option']=="list_category"){
	$menuclass=6;
	
	$dis=$db->fetchArray($db->Query("select * from galleryimages where 1 group by title" ));
	if(!empty($_GET['id'])){
	$Dbh = $db->query("SELECT id,name,metatitle,metakeywords,pagedescription  FROM gallery WHERE id='".$_REQUEST['id']."' and status=1 ");
	$row_act=$db->fetchArray($Dbh);
	$crow_cat=$db->numRows($Dbh);
	if($crow_cat>0)
	{
	$page_title=$row_act['metatitle'];
	$meta_keywords=$row_act['metakeywords'];
	$page_desc=$row_act['pagedescription'];
	}
	}
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/list_category.php";
	}
	
	if($_REQUEST['mod_option']=="vaartha"){
	$menuclass=5;
	$news1=$db->Query("select * from news where status=1 and category='".$_GET['cat']."' group by newson order by id desc");
	$total=$db->numRows($news1);
	$page_title="Telugu film news,telugu movie news,telugu movie reviews,latest telugu film news,telugu cinema news,telugu actor,telugu online songs,online telugu movie,telugu films,telugu songs downloads,telugu newspaper,telugu newspaper,telugu music,telugu movie review,telugu movie stills,free telugu movies,telugu wallpapers,telugu mp3 downloads,general nes,paper cuttings news,telugu cinema news,tollywood movie reviews,tollywood pictures,tollywood gallery";
	$meta_keywords="Telugu mp3 downloads,general nes,paper cuttings news,telugu cinema news,tollywood movie reviews,tollywood pictures,tollywood gallery,Telugu film news,telugu movie news,telugu movie reviews,latest telugu film news,telugu cinema news,telugu actor,telugu online songs,online telugu movie,telugu films,telugu songs downloads,telugu newspaper,telugu newspaper,telugu music,telugu movie review,telugu movie stills,free telugu movies,telugu wallpapers";
	$page_desc="Telugu movie,telugu films,telugu songs downloads,telugu newspaper,telugu newspaper,telugu music,telugu movie review,telugu movie stills,free telugu movies,telugu wallpapers,telugu mp3 downloads,general nes,paper cuttings news,telugu cinema news,tollywood movie reviews,tollywood pictures,tollywood gallery,Telugu film news,telugu movie news,telugu movie reviews,latest telugu film news,telugu cinema news,telugu actor,telugu online songs,online ";
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/news_index.php";
	}

	if($_REQUEST['mod_option']=="newsdesc"){
	$menuclass=5;
	$news=$db->Query("select * from news where status=1 and id=".$_REQUEST['id']."");
	$total=$db->numRows($news);
	$row_news=$db->fetchArray($news);
	$page_title=$row_news['title'];
	$page_desc=$row_news['pagetitle'];
	$meta_keywords=$row_news['metakeywords'];
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/news_description.php";
	}
	
	if($_REQUEST['mod_option']=="gossip"){
	$menuclass=5;
	$gossips1=$db->Query("select * from news where status=1 and category='".$_GET['cat']."'  order by id desc");
	$total=$db->numRows($gossips1);
	$page_title="celebrities gossips,celebrity gossip,celebrity gossips,gossips,latest gossip,gossip news,latest celebrity gossip,celeb gossip,celebs gossip,celebrities gossip,online gossip,lainey gossip,tv gossip,celebrity news and gossip,latest hollywood gossip,gossip celebrity,celebrity gossip sites,lastest,gossip blogs,allu arjun gossips,telugu movie stills,Tollywood actresses wallpapers,telugu photo gallery,telugu wallpapers,telugu film industry,tamil actress,wallpapers actress,indian actress,bollywood actress,asin wallpapers,namitha,bollywood photo,ramya,south actress,actress gallery,indian actresses,telugu actress gossips,tollywood gossips,tollywood actress gossips,telugu film star gossips,telugu actor gossips,tollywood actress gossips";
	$meta_keywords="telugu actress gossips,tollywood gossips,telugu film star gossips,telugu actor gossips,tollywood actress gossips,celebrities gossips,celebrity gossip,celebrity gossips,gossips,latest gossip,gossip news,latest celebrity gossip,celeb gossip,celebs gossip,celebrities gossip,online gossip,lainey gossip,tv gossip,celebrity news and gossip,latest hollywood gossip,gossip celebrity,celebrity gossip sites,lastest,gossip blogs,allu arjun gossips,telugu movie stills,Tollywood actresses wallpapers,telugu photo gallery,telugu wallpapers,telugu film industry,tamil actress,wallpapers actress,indian actress,bollywood actress,asin wallpapers,namitha,bollywood photo,ramya,south actress,actress gallery,indian actresses";
	$page_desc="gossip news,latest celebrity gossip,celeb gossip,celebs gossip,celebrities gossip,online gossip,lainey gossip,tv gossip,celebrity news and gossip,latest hollywood gossip,gossip celebrity,celebrity gossip sites,lastest,gossip blogs,allu arjun gossips,telugu movie stills,Tollywood actresses wallpapers,telugu photo gallery,telugu wallpapers,telugu film industry,tamil actress,wallpapers actress,indian actress,bollywood actress,asin wallpapers,namitha,bollywood photo,ramya,south actress,actress gallery,indian actresses,telugu actress gossips,tollywood gossips,telugu film star gossips,telugu actor gossips,tollywood actress gossips,celebrities gossips,celebrity gossip,celebrity gossips,gossips,latest gossip";
	
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/gossips_index.php";
	}
	
	if($_REQUEST['mod_option']=="gossipview"){
	$menuclass=5;
	$gossipv=$db->Query("select * from news where status=1 and id=".$_REQUEST['id']."");
	$total=$db->numRows($gossipv);$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/gossip.php";
	}
	
	if($_REQUEST['mod_option']=="reviews"){
	$menuclass=5;
	$count=$db->getCount("select count(*) from `reviews` where 1 and status=1 order by id");
	$mv_photo1=$db->query("select * from  `reviews` where 1 and status=1 order by id");
	$total=$db->numRows($mv_photo1);
	$page_title="telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood,telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews,telugu film latest reviews";
	$meta_keywords="telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews,telugu film latest reviews,telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood";
	$page_desc="telugu film latest reviews,telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood,telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews";
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/review_index1.php";
	}
	
	if($_REQUEST['mod_option']=="videosnews"){
	$menuclass=5;
	$count=$db->getCount("select count(*) from `news` where 1 and category='5' and  status=1 order by id");
	$mv_photo1=$db->query("select * from  `news` where 1 and  category='5' and  status=1 order by id");
	$total=$db->numRows($mv_photo1);
	$page_title="telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood,telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews,telugu film latest reviews";
	$meta_keywords="telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews,telugu film latest reviews,telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood";
	$page_desc="telugu film latest reviews,telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood,telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews";
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/news_videos_index.php";
	}
	
	/*if($_REQUEST['mod_option']=="reviews1"){
	$menuclass=5;
	$count=$db->getCount("select count(*) from `reviews` where 1 and status=1 order by id");
	$mv_photo1=$db->query("select * from  `reviews` where 1 and status=1 order by id");
	$total=$db->numRows($mv_photo1);
	$page_title="telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood,telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews,telugu film latest reviews";
	$meta_keywords="telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews,telugu film latest reviews,telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood";
	$page_desc="telugu film latest reviews,telugu movie reviews,telugu cinema reviews,telugu movie news,telugu cinema review,tollywood songs,telugu venkatesh,nagarjuna telugu,telugu tollywood,telugu film reviews,telugu wallpapers,telugu actors,tollywood heroines,tollywood news,telugu film news,telugu wallpapers,reviews";
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/review_index1.php";
	}*/	
	
	if($_REQUEST['mod_option']=="viewreview"){
	$menuclass=5;
	if($_SERVER['REQUEST_METHOD']=="POST"){
	if(!empty($_POST['type'])){
	echo $date=date("Y-m-d");
	$m=$_POST['com'];
	$name=getIdName("reviews","title","id=".$m);
	$cn=SafeURL($name);

	//$db->Query("insert into comments(`id`,`refid`,`title`,`name`,`comment`,`type`,`status`,`dateadded`) values('','".$m."','".$name."','".$_POST['uname']."','".$_POST['comment']."','".$_POST['type']."',1,'".$date."')");
	header("location:".$siteurl."msgsucc-i".$m."-tr/viewreview/".$cn."");
	}}	
	//$vcount=$db->getCount("select count(*) from `comments` where type='r' and refid='".$_GET['i']."' and status=1 order by id");
	
	$re_desc=$db->fetchArray($db->Query("select * from reviews where id='".$_GET['i']."'"));
	$page_title=$re_desc['metatitle'];
	$page_desc=$re_desc['pagetitle'];
	$meta_keywords=$re_desc['metakeywords'];
	$incFILE="modules/review_description.php";
	}
	
	if($_REQUEST['mod_option']=="viewpollresults"){
	$news=$db->Query("select * from news where status=1 and category='".$_GET['cat']."' group by newson order by id desc");
	$total=$db->numRows($news);$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/pollresults.php";
	require_once($incFILE);
	}
	
	if($_REQUEST['mod_option']=="viewcat"){
	$gal_cat=$db->Query("select * from gallery where status=1 and id='".$_GET['id']."'  order by id desc");
	$gal_row=$db->fetchArray($gal_cat);
	$total=$db->numRows($gal_cat);$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/gallery_cats.php";
	}
	
	if($_REQUEST['mod_option']=="viewlargephotos"){
	$menuclass=6;
	$mv_photo=$db->query("select * from  `galleryimages` where id='".$_GET['lid']."'");
	$row_mvphotos=$db->fetchArray($mv_photo);
	$page_title=$row_mvphotos['metatitle'];
	$page_desc=$row_mvphotos['pagedescription'];
	$meta_keywords=$row_mvphotos['metakeywords'];
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/viewlargephotos.php";
	}
	if($_REQUEST['mod_option']=="searchitems"){
	session_unregister("ser_items");
	session_register("ser_items");
	$_SESSION['ser_items']=$_POST['ser_item'];
	$ser_cat=$db->Query("select * from news where  title like '".$_SESSION['ser_items']."%' and status=1  order by id desc");
	$count=$db->numRows($ser_cat);
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/search.php";
	}
	
	if($_REQUEST['mod_option']=="trailers"){
	$menuclass=1;
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	if(!empty($_POST['type'])){
	$m=$_POST['com'];
	$name=getIdName("trailers","title","id=".$m);
	//$db->Query("insert into comments(`id`,`refid`,`title`,`name`,`comment`,`type`,`status`,`dateadded`) values('','".$m."','".$name."','".$_POST['uname']."','".$_POST['comment']."','".$_POST['type']."',0,now())");
	header("location:module.php?mod_option=trailers&msg=succ&id=".$m."&t=t");
	}		
	}
	$count=$db->getCount("select count(*) from `trailers` where 1 and status=1 order by id");
	//$vcount=$db->getCount("select count(*) from `comments` where type='t' and refid='".$_GET['id']."' and status=1 order by id");
	if(!empty($_GET['id'])){
	$trailer=$db->query("select * from  `trailers` where id='".$_GET['id']."' and status=1 order by id");
	$row_trail=$db->fetchArray($trailer);
	$total=$db->numRows($trailer);
	if($total>0){
	$page_title=$row_trail['metatitle'];
	$page_desc=$row_trail['pagedescription'];
	$meta_keywords=$row_trail['metakeywords'];
	}
	}
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/trailers.php";
	}
	
	if($_REQUEST['mod_option']=="newsvideos"){
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	if(!empty($_POST['type']))
	{
	$m=$_POST['com'];
	$name=getIdName("trailers","title","id=".$m);
	//$db->Query("insert into comments(`id`,`refid`,`title`,`name`,`comment`,`type`,`status`,`dateadded`) values('','".$m."','".$name."','".$_POST['uname']."','".$_POST['comment']."','".$_POST['type']."',0,now())");
	header("location:module.php?mod_option=newsvideos&msg=succ&id=".$m."");
	}		
	}
	$count=$db->getCount("select count(*) from `news` where category=5 and status=1 order by id");
	$trailer=$db->query("select * from  `news` where category=5 and status=1 order by id");
	//$vcount=$db->getCount("select count(*) from `comments` where type='v' and refid='".$_GET['id']."' and status=1 order by id");
	$total=$db->numRows($trailer);
	if(!empty($_GET['id'])){
	$mv_photo=$db->query("select * from  `news` where id='".$_GET['id']."' and category=5 and status=1");
	$row_vnews=$db->fetchArray($mv_photo);
	$page_title=$row_vnews['metatitle'];
	$page_desc=$row_vnews['pagetitle'];
	$meta_keywords=$row_vnews['metakeywords'];
	}
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/newsvideos.php";
	}
	
	if($_REQUEST['mod_option']=="tnews"){
	$tnews=$db->Query("select * from news where status=1  and id='".$_GET['id']."' order by id desc");
	$total=$db->numRows($tnews);
	
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/tnews_description.php";
	}
	/*if($_REQUEST['mod_option']=="tcutting"){
	$date_sel=date("Y-m-d");
	
	$today_cuttings1=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles, source,movies,news_on from content where news_on='".$date_sel."' and status=1 ");
	
	
	$page_title="";
	
	
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/todays_cuttings.php";
	
	}*/
	if($_REQUEST['mod_option']=="tcutting"){
	$menuclass=4;
	
	$date_sel=date("Y-m-d");
	/*if(!empty($_GET['rid']))
	{
	$cond4=" and id='".$_GET['rid']."'";
	}
	$news_data1=$db->fetchArray($db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where news_on='".$date_sel."' and status=1 ".$cond4.""));
	*/
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	if(!empty($_REQUEST['month'])){
	$day=date("d");
	if(!empty($_GET['d']) && !empty($_GET['m']) && !empty($_GET['y'])  ){
	$date=$_GET['y']."-".$_GET['m']."-".$_GET['d'];
	}
	else{
	 $date=$_REQUEST['year']."-".$_REQUEST['month']."-".$day;
	}
	
	}
	
	else if(!empty($_GET['d']) && !empty($_GET['m']) && !empty($_GET['y'])  ){
	
	 $date=$_GET['y']."-".$_GET['m']."-".$_GET['d'];
	}
	else if(!empty($_GET['m']) && empty($_GET['y']) && empty($_GET['d'])  ){
	
	 $date="";
	}
	else if(!empty($_GET['m']) && !empty($_GET['y']) && empty($_GET['d'])  ){
	
	 $date="";
	}
	else{
	 $mdt=getdata("content","max(id)","status=1");
	 $date=getdata("content","news_on","id='".$mdt."' and  status=1");
	/*$day=date("d");$year=date("Y");$month=date("m");
	  $date=$year."-".$month."-".$day;*/
	
	}
	//echo "select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where news_on='".$date."' and status=1 ".$cond4."";
	if(!empty($_GET['m'])  && empty($_GET['d']) && empty($_GET['y'])){
	$date="";
	$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on  from content where month(news_on)='".$_GET['m']."' and  status=1 ".$cond4." order by id desc");
	}
	else if(!empty($_GET['m'])  && empty($_GET['d']) && !empty($_GET['y'])){
	$date="";
	$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where month(news_on)='".$_GET['m']."' and  year(news_on)='".$_GET['y']."'  and  status=1 ".$cond4." order by id desc");
	}
	else{
	
	$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where news_on='".$date."'  and  status=1 ".$cond4." order by id desc");
	
	}
	
	}
	else{
	if(!empty($_GET['d']) && !empty($_GET['d']) && !empty($_GET['m'])){
	$day=date("d");/*if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ echo $d=$_GET['h']; }*/
	$date=$_GET['y']."-".$_GET['m']."-".$_GET['d'];
	
	}
	else if(!empty($_GET['m']) && empty($_GET['d']) && empty($_GET['y'])){
	$day=date("d");/*if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ echo $d=$_GET['h']; }*/
	$date="";
	
	}
	else if(!empty($_GET['m']) && empty($_GET['d']) && !empty($_GET['y'])){
	$day=date("d");/*if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ echo $d=$_GET['h']; }*/
	$date="";
	
	}
	else{
	if(!empty($_GET['d'])){$year=date("Y");
	$month=date("m");
	/*$day=date("d");if($_GET['h']<9){ $d=substr($_GET['h'],1);}else{ $d=$_GET['h']; }*/
	if($_GET['d']<10){
	$day="0".$_GET['d'];
	}
	else{
	$day=$_GET['d'];
	}
	$date=$year."-".$month."-".$day;
	
	}
	else{
	 $mdt=getdata("content","max(id)","status=1");
	 $date=getdata("content","news_on","id='".$mdt."' and  status=1");
	/*$year=date("Y");
	$month=date("m");$day=date("d");
	$date=$year."-".$month."-".$day;*/
	}
	}
	
	$news_data=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where news_on='".$date."'  and  status=1 ".$cond4." order by id desc");
	}
	$title_data1_ptitle="";
	$title_data1_keywords="";
	$title_data1_pdesc="";
	$len=3;
	$metacond="";
	if(!empty($_GET['start']) || !empty($_GET['d']) || !empty($_GET['m']) || !empty($_GET['y']) || !empty($_GET['start'])){
	if(!empty($_GET['start'])){ $start=$_GET['start']; }else{ $start=0;}
	if(!empty($_GET['m']) && empty($_GET['d']) && empty($_GET['y'])){
	$metacond="month(news_on)='".$_GET['m']."' and year(news_on)='".date("Y")."' ";
	}
	else if(!empty($_GET['m']) && empty($_GET['d']) && !empty($_GET['y'])){
	$metacond="month(news_on)='".$_GET['m']."' and  year(news_on)='".$_GET['y']."'";
	}
	else if(!empty($_GET['m']) && !empty($_GET['d']) && !empty($_GET['y'])){
	$metacond="month(news_on)='".$_GET['m']."' and  year(news_on)='".$_GET['y']."' and day(news_on)='".$_GET['d']."'";
	
	}else{
	$mdt=getdata("content","max(id)","status=1");
	$date=getdata("content","news_on","id='".$mdt."' and  status=1");
	$metacond=" news_on='".$date."'";
	}
	$ctitle=$db->Query("select id,pagetitle,pagedescription,metakeywords,metatitle,title,image,alt,profiles,source,movies,news_on from content where ".$metacond."  and  status=1 ".$cond4." order by id asc limit ".$start.",3 ");
	$y=0;
	while($row_titles=$db->fetchArray($ctitle)){
	
	if($y<2){ $c=","; }else{ $c=""; }
	
	$title_data1_ptitle.=$row_titles['title'].$c;
	$title_data1_keywords.=$row_titles['metakeywords'].$c;
	$title_data1_pdesc.=$row_titles['pagedescription'].$c;
	$y++;
	}
	}else{
	$title_data1_ptitle="Telugu websites,Telugu film News, Telugu cinema news paper cuttings, Tollywood film magazines, all telugu news papers, telugu film paper clippings, telugu film industry news, telugu film news papers, telugu movie hot topics, tollywood latest news";
	$title_data1_keywords="daily telugu news papers, sakshi film news, eenadu film news, vaartha film news, andhra jyothi film news, andhra prabha film news, superhit cinema news, telugu cinema fans, sakshi cinema news paper cuttings, eenadu cinema news paper cuttings, vaartha cineam news paper cuttings, andhra jyothi cinema news paper cuttings, andhra prabha cinema news paper cuttings";
	$title_data1_pdesc="telugu cinema news papers, telugu cinema daily news papers, telugu movies news, telugu cinema latest news, tollywood 24 frames news, telugu cinema hot gossips, movie news papers, news paper editorials, cinema news papers, telugu cinema weekly news papers, telugu cinema monthly news papers, latest movie news, telugu cinema hot topics, telugu movie paper";
	}
	
	 $page_title=$title_data1_ptitle;
	$meta_keywords=$title_data1_keywords;
	$page_desc=$title_data1_pdesc;
	
	//$meta_title=$news_data1['metatitle'];
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/todays_cuttings.php";
	}
	
	if($_REQUEST['mod_option']=="newsvideoshome"){
	$dis=$db->fetchArray($db->Query("select * from video_category where 1" ));
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/videos_index.php";
	}
	
	if($_REQUEST['mod_option']=="videos"){
	$menuclass=1;
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	if(!empty($_POST['type']))
	{
	$m=$_POST['com'];
	$name=getIdName("videos","title","id=".$m);
	$hname=SafeURL($name);
	//$db->Query("insert into comments(`id`,`refid`,`title`,`name`,`comment`,`type`,`status`,`dateadded`) values('','".$m."','".$name."','".$_POST['uname']."','".$_POST['comment']."','".$_POST['type']."',0,now())");
	header("location:".$siteurl."msgsucc-i".$m."-tnv-c".$_GET['c']."/videos/".$hname."");
	}		
	}
	$count=$db->getCount("select count(*) from `video_category` where 1 and status=1 order by id");
	//$vcount=$db->getCount("select count(*) from `comments` where type='nv' and refid='".$_GET['i']."' and status=1 order by id");
	
	$trailer=$db->query("select * from `video_news` where id='".$_GET['i']."' and status=1 order by id");
	$row_trail=$db->fetchArray($trailer);
	$total=$db->numRows($trailer);
	if($total>0){
	$page_title=$row_trail['metatitle'];
	$page_desc=$row_trail['pagetitle'];
	$meta_keywords=$row_trail['metakeywords'];
	}
	
	$dis=$db->fetchArray($db->Query("select * from video_category where 1" ));
	$trailer=$db->query("select * from  `video_news` where id='".$_GET['i']."' and status=1 order by id");
	$row_trail=$db->fetchArray($trailer);
	$total=$db->numRows($trailer);
	if($total>0){
	$page_title=$row_trail['metatitle'];
	$page_desc=$row_trail['pagetitle'];
	$meta_keywords=$row_trail['metakeywords'];
	}
	
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/videos.php";
	}
	
	if($_REQUEST['mod_option']=="videocat"){
	$dis=$db->fetchArray($db->Query("select * from video_category where 1 and id=".$_GET['c']."" ));
	$incRIGHTFILE="";$incRIGHTHTML="";
	$incFILE="modules/videos_cat_index.php";
	}
	
	if($_REQUEST['mod_option']=="subscribers"){
	$date_sel=date("Y-m-d");
	if($_SERVER['REQUEST_METHOD']=="POST")
	{
	
	$db->Query("insert into newsletters_subscribers(`id`,`email`,`status`,`dateadded`)
	values('','".$_POST['semail']."',0,now())");
	header("location:index.php");
	}
	
	}
	if($_REQUEST['mod_option']=="prevpolls"){
	$page_title="";
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/otherpolls.php";
	}
	
	if($_REQUEST['mod_option']=="pollresults"){
	$page_title="";
	$incRIGHTFILE="";
	$incRIGHTHTML="";
	$incFILE="modules/pollresults.php";
	require_once($incFILE);
	}
	
	if($_REQUEST['mod_option']=="sendtof"){
	$incFILE="modules/sendtof.php";
	require_once($incFILE);
	}
	
	if($_REQUEST['mod_option']=="viewlarge"){
	$incFILE="modules/view_large.php";
	require_once($incFILE);
	}
	
	//$db->query('TRUNCATE TABLE comments');

}else{
	header("location:index.php");
}

if(empty($_REQUEST['istemp'])){ include("n-template.php"); }
?>