Location: PHPKode > projects > News Manager - RSS aggregator > newsmanager/spotnews_qry.php
<?php
	/*******************************************************************************
     **  File          :  spotnews_qry.php                                        **
     **  Author        :  G.Ramkumar                                              **
     **  Description   :  spotnews query displaying 							  **
  	 **  Date          :  14/07/2005                                              **
     **  Last Modified :  02/08/2005                                              **
     **  PHP Version   :  5.0.3                                                   **
     **                                                                           **
     *******************************************************************************/
$catname="select * from category where category_name='$spotlight_' and language='$lang'";
$catname_res=$pg_sql->query_pass($catname,"4");

if($_REQUEST['cat_id']!=""&& $_REQUEST['subcat_id']=="")
  $catid_="where category_id=".$_REQUEST['cat_id'];
elseif($_REQUEST['cat_id']!=""&& $_REQUEST['subcat_id']!="")
  $catid_="where subcategory_id=".$_REQUEST['subcat_id'];
else{
   if($catname_res[0]['category_id']!="")
      $catid_="where category_id=".$catname_res[0]['category_id'];
 }

if($catid_!="")
{
	$spot_qry="select * from newsitem_category $catid_ order by id desc";
	$spot_res=$pg_sql->query_pass($spot_qry,"4");
}


$spotcnt=count($spot_res);


// for Getting Xml _id
for($s=0;$s<$spotcnt;$s++)
{
  $id_S=$spot_res[$s][newsitem_id];

  $xml_readalso_S="select * from rssurl_newsitem where url_newsitem_id=$id_S and frontend_export='Y' and language='$lang'";
  $xml_readalsonews_S=$pg_sql->query_pass($xml_readalso_S,"4");

  $xml_readalso_new_S="select * from new_newsitem where newsitem_id=$id_S and frontend='Y' and language='$lang'";
  $xml_readalsonew_news_S=$pg_sql->query_pass($xml_readalso_new_S,"4");

  if(count($cnt_xml_S)<2)
  {
  	if($xml_readalsonews_S[0]['url_newsitem_id']!="")
  	 {
		  $xml_exist_S=$xml_exist_S;
		  $xml_id_S .=$xml_readalsonews_S[0]['url_newsitem_id'].",";
		  $cnt_xml_S[] =$xml_exist_S;
     }
     if($xml_readalsonew_news_S[0]['newsitem_id']!="")
	 {
		  $xml_exist_S=0;
		  $xml_id_new_S .=$xml_readalsonew_news_S[0]['newsitem_id'].",";
		  $cnt_xml_S[] = $xml_exist_S;
     }

  }
}

?>
Return current item: News Manager - RSS aggregator