' ), array ( '&' , '"', ''' , '<' , '>' ), $string ); } $nl = "\n"; $t = "\t"; if(!$howmany||$howmany<0||$howmany>100) $howmany=10; unset($output); // opening DB $dbl = mysql_connect($db['host'], $db['user'], $db['password']); if(!$dbl) { die('SQL error... sorry ! ^^; I\'m on it !'); } mysql_select_db($db['database'],$dbl); $output = ''.$nl; $output.= ''.$nl; $output.= $t.''.$nl; $output.= $t.$t.'pouet.net'.$nl; $output.= $t.$t.'http://www.pouet.net/'.$nl; $output.= $t.$t.'your online demoscene resource'.$nl; $output.= $t.$t.'en-us'.$nl; $output.= $t.$t.'Copyright 2000-'.date('Y').' Mandarine'.$nl; $output.= $t.$t.'webmaster@pouet.net'.$nl; $output.= $t.$t.'webmaster@pouet.net'.$nl; // lastBuildDate $query = 'SELECT quand FROM prods ORDER BY quand DESC LIMIT 1'; $result = mysql_query($query); $lastBuildDate = date('D, d M Y H:i:s',strtotime(mysql_result($result, 0))); $output.= $t.$t.''.$lastBuildDate.' CST'.$nl; $output.= $t.$t.'pouet.net'.$nl; $output.= $t.$t.'http://backend.userland.com/rss'.$nl; $output.= $t.$t.'60'.$nl; // logo $output.= $t.$t.''.$nl; $output.= $t.$t.$t.'http://www.pouet.net/gfx/buttons/pouet.gif'.$nl; $output.= $t.$t.$t.'pouet.net'.$nl; $output.= $t.$t.$t.'http://www.pouet.net/'.$nl; $output.= $t.$t.$t.'88'.$nl; $output.= $t.$t.$t.'31'.$nl; $output.= $t.$t.$t.'your online demoscene resource'.$nl; $output.= $t.$t.''.$nl; // getting data unset($prods); $query ='SELECT prods.id,prods.name,prods.date FROM prods '; if ($platform) $query.=", prods_platforms, platforms "; $query.="WHERE 1 "; if ($platform) $query.="and prods_platforms.platform=platforms.id and platforms.name='".$platform."' and prods_platforms.prod=prods.id "; if ($type) $query.='AND find_in_set("'.$type.'",prods.type)>0 '; if ($group) $query.='AND (prods.group1="'.$group.'" OR prods.group2="'.$group.'" OR prods.group3="'.$group.'") '; $query.='ORDER BY prods.date DESC, prods.quand DESC LIMIT '.$howmany; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) $prods[] = $row; // publishing each prod as foreach($prods as $p) { $output.= $t.$t.''.$nl; $output.= $t.$t.$t.''.xmlentities(utf8_encode($p['name'])).''.$nl; $output.= $t.$t.$t.'http://www.pouet.net/prod.php?which='.$p['id'].''.$nl; // enclosure tag unset($screenshot); if(file_exists('../screenshots/'.$p['id'].'.jpg')) { $screenshot = $p['id'].'.jpg'; } elseif(file_exists('../screenshots/'.$p['id'].'.gif')) { $screenshot = $p['id'].'.gif'; } elseif(file_exists('../screenshots/'.$p['id'].'.png')) { $screenshot = $p['id'].'.png'; } if($screenshot) { $screenshot_size = filesize('../screenshots/'.$screenshot); $size = getimagesize('../screenshots/'.$screenshot); $screenshot_type = $size['mime']; $output.= $t.$t.$t.''.$nl; } $output.= $t.$t.$t.''.$p['id'].''.$nl; $output.= $t.$t.$t.''.date('D, d M Y H:i:s',strtotime($p['date'])).' CST'.$nl; $output.= $t.$t.''.$nl; } $output.= $t.''.$nl; $output.= ''.$nl; // closing DB if (isset($dbl)) { mysql_close($dbl); } print($output); ?>