$news=$DB->GetAll("SELECT * FROM news WHERE sticky=true AND expiry > now() ORDER BY date DESC");
if(count($news)<3){
$news=$DB->GetAll("(SELECT * FROM news WHERE sticky=false AND expiry > now() ORDER by date DESC LIMIT ".(3-count($news)).") UNION SELECT * FROM news WHERE sticky=true AND expiry > now() ORDER BY date DESC");
}
if(count($news)<1){
$news=$DB->GetAll("SELECT * FROM poems ORDER BY RANDOM() LIMIT 1");
$poemmode=1;
}
$motd="----------------------------- MESSAGE OF THE DAY ------------------------------\n\n";