Location: PHPKode > projects > News Manager - RSS aggregator > newsmanager/list_channels_qry.php
<?php
  $total_chan="select * from rsschannel where channel_language='".$lang."' and channel_status='Y'";
  $total_chan_res=$pg_sql->query_pass($total_chan,"4");

  $total_num = count($total_chan_res);
  $limit  = 20; // Set limit display news item per page
  $offset = 0;
  if($_REQUEST['offset']>0){
    $offset = $_REQUEST['offset'];
  }

$chan_list_qry="select channel_id,channel_image,channel_title,channel_language  from rsschannel where channel_language='".$lang."' and channel_status='Y' order by channel_id desc limit $limit offset $offset";  
$chan_list_qry_res=$pg_sql->query_pass($chan_list_qry,'4');
?>
<table cellpadding="3" cellspacing="0" align="left" width="100%" border="0">
<?
for($lc=0;$lc<count($chan_list_qry_res);$lc++){
	  if(trim($chan_list_qry_res[$lc]['channel_image'])!=''){
         if(strstr($chan_list_qry_res[$lc]['channel_image'],'http://')){
		    $ch_image_png=$chan_list_qry_res[$lc]['channel_image'];
		 }else{
            $path_img=explode(".",$chan_list_qry_res[$lc]['channel_image']);
			$pathinfo=$path_img[1];
		    $ch_image_png='login/newsimages/'.$chan_list_qry_res[$lc]['channel_id'].'.'.$pathinfo;
		 }  
		 
		 if(!file_exists('login/newsimages/'.$chan_list_qry_res[$lc]['channel_id'].'png'))
   	       copy($ch_image_png,'login/newsimages/'.$chan_list_qry_res[$lc]['channel_id'].'.png');
	  }
?>
 <tr align="right" class="cont">
    <td align="left" valign="top"><a href="list_items.php?id=<?=$chan_list_qry_res[$lc]['channel_id']?>&lang=<?=$lang?>" class="contblue2"><?=$chan_list_qry_res[$lc]['channel_title']?></a></td>
<?
  if(trim($chan_list_qry_res[$lc]['channel_image'])!=''){
?>
	<td align="left" valign="top"><a href="login/newsimages/<?=$chan_list_qry_res[$lc]['channel_id']?>.png" target="new"><img src="login/newsimages/<?=$chan_list_qry_res[$lc]['channel_id']?>.png" width="30" height="30" border="0"></a></td>
<?}?>
 </tr>
<?}?>
</table>
Return current item: News Manager - RSS aggregator