0) $visitdate = date("Y-m-d H:i:00",$lastvisitdate); $sql = "select * from ".$tableprefix."_events where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; if($separatebylang==1) $sql.= "and lang='$lang' "; if($category>=0) $sql.= "and category='$category' "; else { $sql.="and linkeventnr=0 "; $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=1"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) $sql.="and category!=".$tmprow["catnr"]." "; } if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) $hasentries=1; if(($lastvisitdate>0) && ($hasentries>0)) { $sql.= " and added>='$visitdate'"; if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) $hasentries=2; } if(bittst($announceoptions,BIT_3)) { $acttime=transposetime(time(),$servertimezone,$displaytimezone); $sql = "select * from ".$tableprefix."_announce where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' and (expiredate>=$acttime or expiredate=0) and (firstdate<=$acttime or firstdate=0) "; if($separatebylang==1) $sql.="and lang='$lang' "; if($category>0) $sql.= "and (category='$category' or category=0)"; else if($category==0) $sql.= "and category=0"; if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if((mysql_num_rows($result)>0) && ($hasentries<1)) { list($year, $month, $day) = explode("-", $link_date); $linkdate=mktime(0,0,0,$month,$day,$year); if($linkdate>$lastvisitdate) $hasentries=2; else $hasentries=1; } } if(($newsineventcal==1) && ($hasentries<1)) { $sql ="select * from ".$tableprefix."_data where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; if($showfuturenews==0) $sql.="and date<='$actdate' "; if($separatebylang==1) $sql.="and lang='$lang' "; if($category>=0) $sql.= "and category='$category' "; else { $sql.="and linknewsnr=0 "; $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=1"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) $sql.="and category!=".$tmprow["catnr"]." "; } if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if((mysql_num_rows($result)>0) && ($hasentries<1)) { list($year, $month, $day) = explode("-", $link_date); $linkdate=mktime(0,0,0,$month,$day,$year); if($linkdate>$lastvisitdate) $hasentries=2; else $hasentries=1; } } return $hasentries; } function get_num_events($link_date, $newsineventcal, $lang, $tableprefix, $db, $category, $lastvisitdate) { global $separatebylang, $actdate; $numentries=0; if($lastvisitdate>0) $visitdate = date("Y-m-d H:i:00",$lastvisitdate); $sql = "select * from ".$tableprefix."_events where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; if($separatebylang==1) $sql.= "and lang='$lang' "; if($category>=0) $sql.= "and category='$category' "; else { $sql.="and linkeventnr=0 "; $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=1"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) $sql.="and category!=".$tmprow["catnr"]." "; } if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) $numentries+=mysql_num_rows($result); if($newsineventcal==1) { $sql = "select * from ".$tableprefix."_data where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; $sql.= "and date<='$actdate' "; if($separatebylang==1) $sql.="and lang='$lang' "; if($category>=0) $sql.= "and category='$category' "; else { $sql.="and linknewsnr=0 "; $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=1"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) $sql.="and category!=".$tmprow["catnr"]." "; } if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) $numentries+=mysql_num_rows($result); } return $numentries; } function display_event_shorts($link_date, $newsineventcal, $lang, $tableprefix, $db, $category, $lastvisitdate, $shortlength, $shortnum, $onlyheadings, $backurl, $altlinkdest="") { global $separatebylang, $layout, $newsheadingstyle, $l_more, $url_gfx, $newentrypic, $l_showevents, $url_simpnews, $morepic, $actdate; global $announceoptions, $announcepic, $langvar, $l_announcements, $gannouncepic, $maxevcannounce, $servertimezone, $displaytimezone; $entriesleft=$maxevcannounce; if(bittst($announceoptions,BIT_3)) { $acttime=transposetime(time(),$servertimezone,$displaytimezone); $sql = "select * from ".$tableprefix."_announce where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' and (expiredate>=$acttime or expiredate=0) and (firstdate<=$acttime or firstdate=0) "; if($separatebylang==1) $sql.="and lang='$lang' "; if($category>0) $sql.= "and (category='$category' or category=0)"; else if($category==0) $sql.= "and category=0"; if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) { if(!bittst($announceoptions,BIT_1)) $announceurl=$url_simpnews."/announce.php?$langvar=$lang&category=$category&link_date=$link_date&backurl=".urlencode($backurl); else $announceurl=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo ""; if(!bittst($announceoptions,BIT_4)) { echo ""; } else { while(($entriesleft>0) && ($myrow=mysql_fetch_array($result))) { $entriesleft--; echo ""; } } echo "
"; echo ""; echo ""; echo "
"; echo ""; if(strlen($myrow["heading"])>0) { echo get_start_tag($newsheadingstyle); echo undo_html_ampersand(do_htmlentities(stripslashes($myrow["heading"]))); echo get_end_tag($newsheadingstyle); echo "
"; } if($onlyheadings!=1) { $displaytext=undo_htmlspecialchars(stripslashes($myrow["text"])); if($shortlength>0) { $displaytext=strip_tags($displaytext); $displaytext=substr($displaytext,0,$shortlength); } echo $displaytext; } echo " 
"; if($myrow["category"]==0) $displaypic=$gannouncepic; else $displaypic=$announcepic; echo "\"$l_announcements\""; echo "
"; } } $entriesleft=$shortnum; if($lastvisitdate>0) $visitdate = date("Y-m-d H:i:00",$lastvisitdate); $sql = "select * from ".$tableprefix."_events where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; if($separatebylang==1) $sql.= "and lang='$lang' "; if($category>=0) $sql.= "and category='$category'"; else { $sql.="and linkeventnr=0 "; $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=1"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) $sql.="and category!=".$tmprow["catnr"]." "; } if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) { echo ""; while(($entriesleft>0) && ($myrow=mysql_fetch_array($result))) { if($myrow["linkeventnr"]==0) $entrydata=$myrow; else { $tmpsql="select * from ".$tableprefix."_events where eventnr=".$myrow["linkeventnr"]; if(!$tmpresult = mysql_query($tmpsql, $db)) die(""; } echo "
Unable to connect to database.".mysql_error()); if(!$tmprow=mysql_fetch_array($tmpresult)) die("
Unable to get data"); $entrydata=$tmprow; } echo "
"; $entriesleft--; if(isset($lastvisitdate)) { list($mydate,$mytime)=explode(" ",$entrydata["added"]); list($year, $month, $day) = explode("-", $mydate); list($hour, $min, $sec) = explode(":",$mytime); $thisentrydate=mktime($hour,$min,$sec,$month,$day,$year); if($thisentrydate>=$lastvisitdate) echo ""; } if(!$morepic) { $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo ""; } else echo ""; if(strlen($entrydata["heading"])>0) { echo get_start_tag($newsheadingstyle); echo undo_html_ampersand(do_htmlentities(stripslashes($entrydata["heading"]))); echo get_end_tag($newsheadingstyle); echo "
"; } if($onlyheadings!=1) { $displaytext=undo_htmlspecialchars(stripslashes($entrydata["text"])); if($shortlength>0) { $displaytext=strip_tags($displaytext); $displaytext=substr($displaytext,0,$shortlength); } echo $displaytext; } if($morepic) { $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo "
 
"; echo "\"$l_showevents\""; } echo "
"; } if($entriesleft<1) { $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo ""; if($morepic) echo "\"$l_showevents\""; else echo $l_more; echo ""; return; } if($newsineventcal==0) return; $sql = "select * from ".$tableprefix."_data where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; $sql.= "and date<='$actdate' "; if($separatebylang==1) $sql.="and lang='$lang' "; if($category>=0) $sql.= "and category='$category' "; else { $sql.="and linknewsnr=0 "; $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=1"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) $sql.="and category!=".$tmprow["catnr"]." "; } if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) { echo ""; while(($entriesleft>0) && ($myrow=mysql_fetch_array($result))) { if($myrow["linknewsnr"]==0) $entrydata=$myrow; else { $tmpsql="select * from ".$tableprefix."_data where newsnr=".$myrow["linknewsnr"]; if(!$tmpresult = mysql_query($tmpsql, $db)) die(""; } echo "
Unable to connect to database.".mysql_error()); if(!$tmprow=mysql_fetch_array($tmpresult)) die("
Unable to get data"); $entrydata=$tmprow; } echo "
"; $entriesleft--; if(isset($lastvisitdate)) { list($mydate,$mytime)=explode(" ",$myrow["date"]); list($year, $month, $day) = explode("-", $mydate); list($hour, $min, $sec) = explode(":",$mytime); $thisentrydate=mktime($hour,$min,$sec,$month,$day,$year); if($thisentrydate>=$lastvisitdate) echo ""; } if(!$morepic) { $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=".$entrydata["category"]."&backurl=".urlencode($backurl); echo ""; } else echo ""; if(strlen($entrydata["heading"])>0) { echo get_start_tag($newsheadingstyle); echo undo_html_ampersand(do_htmlentities(stripslashes($entrydata["heading"]))); echo get_end_tag($newsheadingstyle); echo "
"; } if($onlyheadings!=1) { $displaytext=undo_htmlspecialchars(stripslashes($entrydata["text"])); if($shortlength>0) { $displaytext=strip_tags($displaytext); $displaytext=substr($displaytext,0,$shortlength); } echo $displaytext; } if($morepic) { $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo "
 
"; echo "\"$l_showevents\""; } echo "
"; } if($entriesleft<1) { $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo ""; if($morepic) echo "\"$l_showevents\""; else echo $l_more; echo ""; return; } } function display_event_shorts2($link_date, $newsineventcal, $lang, $tableprefix, $db, $category, $lastvisitdate, $shortlength, $shortnum, $onlyheadings, $backurl) { global $separatebylang, $layout, $newsheadingstyle, $l_more, $url_gfx, $newentrypic, $l_showevents, $url_simpnews, $morepic, $actdate; global $announceoptions, $announcepic, $langvar, $l_announcements, $gannouncepic, $maxevcannounce, $servertimezone, $displaytimezone; global $usehnlinkdest, $hnlinkdest, $hnlinkdestan, $hnlinkdestev; $entriesleft=$maxevcannounce; if(bittst($announceoptions,BIT_3)) { $acttime=transposetime(time(),$servertimezone,$displaytimezone); $sql = "select * from ".$tableprefix."_announce where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' and (expiredate>=$acttime or expiredate=0) and (firstdate<=$acttime or firstdate=0) "; if($separatebylang==1) $sql.="and lang='$lang' "; if($category>0) $sql.= "and (category='$category' or category=0)"; else if($category==0) $sql.= "and category=0"; if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) { if(!bittst($announceoptions,BIT_1)) { if($usehnlinkdest==1) $announceurl="$hnlinkdestan?$langvar=$lang&category=$category&link_date=$link_date&backurl=".urlencode($backurl); else $announceurl=$url_simpnews."/announce.php?$langvar=$lang&category=$category&link_date=$link_date&backurl=".urlencode($backurl); } else { if($usehnlinkdest==1) $announceurl="$hnlinkdestev?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); else $announceurl=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); } echo ""; if(!bittst($announceoptions,BIT_4)) { echo ""; } else { while(($entriesleft>0) && ($myrow=mysql_fetch_array($result))) { $entriesleft--; echo ""; } } echo "
"; echo ""; echo ""; echo "
"; echo ""; if(strlen($myrow["heading"])>0) { echo get_start_tag($newsheadingstyle); echo undo_html_ampersand(do_htmlentities(stripslashes($myrow["heading"]))); echo get_end_tag($newsheadingstyle); echo "
"; } if($onlyheadings!=1) { $displaytext=undo_htmlspecialchars(stripslashes($myrow["text"])); if($shortlength>0) { $displaytext=strip_tags($displaytext); $displaytext=substr($displaytext,0,$shortlength); } echo $displaytext; } echo " 
"; if($myrow["category"]==0) $displaypic=$gannouncepic; else $displaypic=$announcepic; echo "\"$l_announcements\""; echo "
"; } } $entriesleft=$shortnum; if($lastvisitdate>0) $visitdate = date("Y-m-d H:i:00",$lastvisitdate); $sql = "select * from ".$tableprefix."_events where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; if($separatebylang==1) $sql.= "and lang='$lang' "; if($category>=0) $sql.= "and category='$category'"; else { $sql.="and linkeventnr=0 "; $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=1"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) $sql.="and category!=".$tmprow["catnr"]." "; } if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) { echo ""; while(($entriesleft>0) && ($myrow=mysql_fetch_array($result))) { if($myrow["linkeventnr"]==0) $entrydata=$myrow; else { $tmpsql="select * from ".$tableprefix."_events where eventnr=".$myrow["linkeventnr"]; if(!$tmpresult = mysql_query($tmpsql, $db)) die(""; } echo "
Unable to connect to database.".mysql_error()); if(!$tmprow=mysql_fetch_array($tmpresult)) die("
Unable to get data"); $entrydata=$tmprow; } echo "
"; $entriesleft--; if(isset($lastvisitdate)) { list($mydate,$mytime)=explode(" ",$entrydata["added"]); list($year, $month, $day) = explode("-", $mydate); list($hour, $min, $sec) = explode(":",$mytime); $thisentrydate=mktime($hour,$min,$sec,$month,$day,$year); if($thisentrydate>=$lastvisitdate) echo ""; } if(!$morepic) { if($usehnlinkdest==1) $linkdest="$hnlinkdestev?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); else $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo ""; } else echo ""; if(strlen($entrydata["heading"])>0) { echo get_start_tag($newsheadingstyle); echo undo_html_ampersand(do_htmlentities(stripslashes($entrydata["heading"]))); echo get_end_tag($newsheadingstyle); echo "
"; } if($onlyheadings!=1) { $displaytext=undo_htmlspecialchars(stripslashes($entrydata["text"])); if($shortlength>0) { $displaytext=strip_tags($displaytext); $displaytext=substr($displaytext,0,$shortlength); } echo $displaytext; } if($morepic) { if($usehnlinkdest==1) $linkdest="$hnlinkdestev?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); else $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo "
 
"; echo "\"$l_showevents\""; } echo "
"; } if($entriesleft<1) { if($usehnlinkdest==1) $linkdest="$hnlinkdestev?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); else $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo ""; if($morepic) echo "\"$l_showevents\""; else echo $l_more; echo ""; return; } if($newsineventcal==0) return; $sql = "select * from ".$tableprefix."_data where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; $sql.= "and date<='$actdate' "; if($separatebylang==1) $sql.="and lang='$lang' "; if($category>=0) $sql.= "and category='$category' "; else { $sql.="and linknewsnr=0 "; $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=1"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) $sql.="and category!=".$tmprow["catnr"]." "; } if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) { echo ""; while(($entriesleft>0) && ($myrow=mysql_fetch_array($result))) { if($myrow["linknewsnr"]==0) $entrydata=$myrow; else { $tmpsql="select * from ".$tableprefix."_data where newsnr=".$myrow["linknewsnr"]; if(!$tmpresult = mysql_query($tmpsql, $db)) die(""; } echo "
Unable to connect to database.".mysql_error()); if(!$tmprow=mysql_fetch_array($tmpresult)) die("
Unable to get data"); $entrydata=$tmprow; } echo "
"; $entriesleft--; if(isset($lastvisitdate)) { list($mydate,$mytime)=explode(" ",$myrow["date"]); list($year, $month, $day) = explode("-", $mydate); list($hour, $min, $sec) = explode(":",$mytime); $thisentrydate=mktime($hour,$min,$sec,$month,$day,$year); if($thisentrydate>=$lastvisitdate) echo ""; } if(!$morepic) { if($usehnlinkdest==1) $linkdest="$hnlinkdestev?$langvar=$lang&layout=$layout&link_date=$link_date&category=".$entrydata["category"]."&backurl=".urlencode($backurl); else $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=".$entrydata["category"]."&backurl=".urlencode($backurl); echo ""; } else echo ""; if(strlen($entrydata["heading"])>0) { echo get_start_tag($newsheadingstyle); echo undo_html_ampersand(do_htmlentities(stripslashes($entrydata["heading"]))); echo get_end_tag($newsheadingstyle); echo "
"; } if($onlyheadings!=1) { $displaytext=undo_htmlspecialchars(stripslashes($entrydata["text"])); if($shortlength>0) { $displaytext=strip_tags($displaytext); $displaytext=substr($displaytext,0,$shortlength); } echo $displaytext; } if($morepic) { if($usehnlinkdest==1) $linkdest="$hnlinkdestev?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); else $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo "
 
"; echo "\"$l_showevents\""; } echo "
"; } if($entriesleft<1) { if($usehnlinkdest==1) $linkdest="$hnlinkdestev?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); else $linkdest=$url_simpnews."/events.php?$langvar=$lang&layout=$layout&link_date=$link_date&category=$category&backurl=".urlencode($backurl); echo ""; if($morepic) echo "\"$l_showevents\""; else echo $l_more; echo ""; return; } } function event_markers($link_date, $newsineventcal, $lang, $tableprefix, $db, $category, $lastvisitdate) { global $separatebylang, $l_general, $evmarkcolgeneral, $actdate; if($category!=-1) return; if($lastvisitdate>0) $visitdate = date("Y-m-d H:i:00",$lastvisitdate); $sql = "select * from ".$tableprefix."_events where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; if($separatebylang==1) $sql.= "and lang='$lang' "; $sql.= "and category=0"; if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) echo "\"$l_general\""; else if($newsineventcal) { $sql2 = "select * from ".$tableprefix."_data where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; $sql2.= "and date<='$actdate' "; if($separatebylang==1) $sql2.="and lang='$lang' "; $sql2.="and category=0"; if(!$result2 = mysql_query($sql2, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result2)>0) echo "\"$l_general\""; } $tmpsql="select * from ".$tableprefix."_categories where hideintotallist=0 order by displaypos asc"; if(!$tmpresult = mysql_query($tmpsql, $db)) die("Unable to connect to database.".mysql_error()); while($tmprow=mysql_fetch_array($tmpresult)) { $sql = "select * from ".$tableprefix."_events where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; if($separatebylang==1) $sql.= "and lang='$lang' "; $sql.="and linkeventnr=0 "; $sql.="and category=".$tmprow["catnr"]; if(!$result = mysql_query($sql, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result)>0) { $cattext=display_encoded(stripslashes($tmprow["catname"])); $tmpsql2="select * from ".$tableprefix."_catnames where catnr=".$tmprow["catnr"]." and lang='".$act_lang."'"; if(!$tmpresult2=mysql_query($tmpsql2,$db)) die("Unable to connect to database.".mysql_error()); if($tmprow2=mysql_fetch_array($tmpresult2)) { if(strlen($tmprow2["catname"])>0) $cattext=display_encoded(stripslashes($tmprow2["catname"])); } echo "\"".$cattext."\""; } else if($newsineventcal) { $sql2 = "select * from ".$tableprefix."_data where DATE_FORMAT(date,'%Y-%m-%d')='$link_date' "; $sql2.= "and date<='$actdate' "; if($separatebylang==1) $sql2.="and lang='$lang' "; $sql2.="and category=".$tmprow["catnr"]; if(!$result2 = mysql_query($sql2, $db)) die("Unable to connect to database.".mysql_error()); if(mysql_num_rows($result2)>0) { $cattext=display_encoded(stripslashes($tmprow["catname"])); $tmpsql2="select * from ".$tableprefix."_catnames where catnr=".$tmprow["catnr"]." and lang='".$act_lang."'"; if(!$tmpresult2=mysql_query($tmpsql2,$db)) die("Unable to connect to database.".mysql_error()); if($tmprow2=mysql_fetch_array($tmpresult2)) { if(strlen($tmprow2["catname"])>0) $cattext=display_encoded(stripslashes($tmprow2["catname"])); } echo "\"".$cattext."\""; } } } } ?>