<? require_once("../bootstrap.inc.php"); require_once( POUET_ROOT_LOCAL . "/include_pouet_index/box-index-bbs-latest.php"); require_once( POUET_ROOT_LOCAL . "/include_pouet/pouet-rss.php"); $limit = $_GET["howmany"] ? $_GET["howmany"] : 10; $limit = min($limit,25); $limit = max($limit,5); $p = new PouetBoxIndexLatestBBS(); $p->Load(true); $rss = new PouetRSS(); $n = 1; foreach($p->data as $item) { $rss->AddItem(array( "title" => $item->topic, "link" => POUET_ROOT_URL . "topic.php?which=" . $item->id, "pubDate" => date("r",strtotime($item->lastpost)), )); if ($n++ >= $limit) break; } $rss->Render(); ?>
{ $platformID = -1; foreach($PLATFORMS as $k=>$v) if ($v["name"] == $_GET["platform"]) $platformID = $k; if ($platformID != -1) { $s->AddJoin("LEFT","prods_platforms as pp","pp.prod = prods.id"); $s->AddWhere(sprintf_esc("pp.platform = %d",$platformID)); } } $data = $s->perform(); PouetCollectPlatforms($data); $rss = new PouetRSS(); foreach($data as $item) { $rss->AddItem(array( "title" => $item->name . ($item->groups ? " by ".$item->RenderGroupsPlain() : ""), "pouet:title" => $item->name, "pouet:group" => array_map(function($i){ return $i->name; },$item->groups), "pouet:party" => array_map(function($i){ return trim($i->party->name." ".$i->year); },$item->placings), "pouet:type" => explode(",",$item->type), "pouet:platform" => array_map(function($i){ return $i["name"]; },$item->platforms), "link" => POUET_ROOT_URL . "prod.php?which=" . $item->id, "pubDate" => date("r",strtotime($item->addedDate)), "enclosure" => find_screenshot($item->id), )); }
$s = new BM_Query("comments"); $s->AddField("comments.id"); $s->AddField("comments.addedDate"); $s->AddField("comments.comment"); $s->AddField("comments.rating"); $s->attach(array("comments"=>"which"),array("prods as prod"=>"id")); $s->attach(array("comments"=>"who"),array("users as user"=>"id")); $s->AddWhere(sprintf_esc("comments.which = %d",$_GET["prod"])); $s->AddOrder("comments.addedDate DESC"); $s->SetLimit($limit); $data = $s->perform(); $first = reset($data); $rss = new PouetRSS(array( "title"=>"pouët.net - prod comments for ".$first->prod->name, "link"=>$first->prod->GetLink(), )); $votes = array( -1 => "sucks", 0 => "isok", 1 => "rulez" ); foreach($data as $item) { $rss->AddItem(array( "title" => $item->user->nickname, "description" => $item->comment, "link" => POUET_ROOT_URL . "prod.php?post=" . $item->id, "pubDate" => date("r",strtotime($item->addedDate)), "guid" => $item->id, "pouet:vote" => $votes[ $item->rating ], )); }