2 /*------begin------ This protection code was suggested by Luki R. luki@karet.org ---- */
3 if (eregi("inc_news_get.php",$PHP_SELF))
4 die('<meta http-equiv="refresh" content="0; url=../">');
7 $dbtable='care_news_article';
10 /* Establish db connection */
11 if(!isset($db) ||
!$db) include_once($root_path.'include/inc_db_makelink.php');
16 $str_sql="SELECT nr,title,preface,body,pic_mime FROM ".$dbtable."
17 WHERE dept_nr=".$dept_nr;
19 $stat_pending=" AND status<>'pending'";
20 $order_by_desc=" ORDER BY create_time DESC";
22 for($i=1;$i<=$news_num_stop;$i++
)
24 $sql=$str_sql." AND art_num='".$i."'";
25 $publish_when=" AND publish_date='".$today."'";
26 if(defined('MODERATE_NEWS') && (MODERATE_NEWS
==1))
28 $sql.=$publish_when.$stat_pending;
37 if($ergebnis=$db->Execute($sql))
39 if($rows=$ergebnis->RecordCount())
41 $art[$i]=$ergebnis->FetchRow();
43 else // if no file found get the last entry
46 $sql=$str_sql." AND art_num='".$i."'";
47 $publish_when=" AND publish_date<'".$today."'";
49 if(defined('MODERATE_NEWS') && (MODERATE_NEWS
==1))
51 $sql.=$publish_when.$stat_pending;
60 if($ergebnis=$db->Execute($sql))
62 if($rows=$ergebnis->RecordCount())
64 $art[$i]=$ergebnis->FetchRow();
70 } else { echo "$LDDbNoLink $sql<br>"; }