<?php
include("require.php");
$phpcolor->table="flash";
$phpcolor->field="*";
if(isset($_GET['id']) && $_GET['id']!=0)
{
  submitfilter($_GET['id']);
  $phpcolor->where="id = ".$_GET['id'];
  $flash=$phpcolor->exist(1);
  $tpl -> assign("flash", $flash);
  $tpl -> assign("type", $_GET['id']);
  $tpl -> assign("core_header_title", $flash['flashname']." - FLASH娱乐中心 - ");
}
else
{
  if(!isset($_GET['action']))
    $_GET['action']="all";
  if(!isset($_GET['page']))
    $_GET['page']=0;
  if($_GET['action']=="game")
  {
    $phpcolor->where="belong = 1";
    $count = $phpcolor->exist(2);
    $phpcolor->where="belong = 1 order by id desc limit ".($_GET['page']*28).",28";
  }
  elseif($_GET['action']=="music")
  {
    $phpcolor->where="belong = 2";
    $count = $phpcolor->exist(2);
    $phpcolor->where="belong = 2 order by id desc limit ".($_GET['page']*28).",28";
  }
  elseif($_GET['action']=="donghua")
  {
    $phpcolor->where="belong = 3";
    $count = $phpcolor->exist(2);
    $phpcolor->where="belong = 2 order by id desc limit ".($_GET['page']*28).",28";
  }
  else
  {
    $phpcolor->where="1 = 1";
    $count = $phpcolor->exist(2);
    $phpcolor->where="1 = 1 order by id desc limit ".($_GET['page']*28).",28";
  }
  $flash=$phpcolor->assignment();
  $page=pages($count,'28',$_GET['page'],'flash','','','0');
  $tpl -> assign("flash", $flash);
  $tpl -> assign("action", $_GET['action']);
  $tpl -> assign("type", "0");
  $tpl -> assign("page", $page);
  $tpl -> assign("core_header_title", "FLASH娱乐中心 - ");
}
$tpl -> display("$core_style/flash.htm");
?>