template_dir = './template/'; // ģļĿ¼ $subtitle=$_GET['sub']; include_once('./admin/lib/pp.php'); $i=0; if ($subtitle==''){ $total = $db->GetOne("SELECT COUNT(release_id) FROM gp_release where not (release_pubtime is null) AND release_ent_id=$ent_id"); $SQL = "SELECT release_id,release_name,release_time,release_master,release_total FROM gp_release where not (release_pubtime is null) AND release_ent_id=$ent_id Order by release_time desc"; $show_pp = $pp->PP($total,9); $rs = $db->SelectLimit($SQL,$pp->psize,$pp->sid); $i = 0; while(!$rs->EOF) { $release_id = $rs->fields[f_filter('release_id')]; $release_name = $rs->fields[f_filter('release_name')]; $release_master= $rs->fields[f_filter('release_master')]; $release_time = $rs->fields[f_filter('release_time')]; $release_total = $rs->fields[f_filter('release_total')]; $sql ="select paper_url from gp_paper where paper_release_id=$release_id order by paper_name_cn"; $release_paper_url = $db->GetOne($sql); $path_parts = pathinfo($release_paper_url); $ext = $path_parts["extension"]; $ext ='.'.$ext.'.'.$ext; $release_paper_url = substr($release_paper_url.$ext,1); $release_time = substr($release_time,0,10); $release_name=($release_total=="")? $release_name :$release_name.'('.$release_total.')'; $arr[$i] = array( '_i' => $i, 'id' => $release_id, 'name' => $release_name, 'master' => $release_master, 'time' => $release_time, 'index' => '1', 'paper_url'=> $release_paper_url ); $rs->MoveNext(); $i++; } }else{ $sql="select * from gp_paper,gp_release where paper_release_id=release_id and paper_name_cn like '%$subtitle%' order by release_time desc,paper_name_cn"; $rs = $db->Execute($sql); $last_release_id=-1; while(!$rs->EOF) { $release_id=$rs->fields[f_filter('release_id')]; if ($last_release_id==$release_id) { $rs->MoveNext(); continue; }else{ $last_release_id=$release_id; } $paper_id=$rs->fields[f_filter('paper_id')]; $paper_name_cn=$rs->fields[f_filter('paper_name_cn')]; $paper_index=substr($paper_name_cn,2,2); $paper_index=$paper_index*1; if($paper_index % 4 !=1 ) { $rs->MoveNext(); continue; } $release_id = $rs->fields[f_filter('release_id')]; $release_name = $rs->fields[f_filter('release_name')]; $release_master= $rs->fields[f_filter('release_master')]; $release_time = $rs->fields[f_filter('release_time')]; $release_total = $rs->fields[f_filter('release_total')]; $sql ="select paper_url from gp_paper where paper_id=$paper_id"; $release_paper_url = $db->GetOne($sql); $path_parts = pathinfo($release_paper_url); $ext = $path_parts["extension"]; $ext ='.'.$ext.'.'.$ext; $release_paper_url = substr($release_paper_url.$ext,1); $release_time = substr($release_time,0,10); $release_name=($release_total=="")? $release_name :$release_name.'('.$release_total.')'; $arr[$i] = array( '_i' => $i, 'id' => $release_id, 'name' => $release_name, 'master' => $release_master, 'time' => $release_time, 'index' => $paper_index, 'paper_url'=> $release_paper_url ); $rs->MoveNext(); $i++; } } //print_r($arr); $smarty->assign('pp',$show_pp); $smarty->assign('_release_count',$i); $smarty->assign('releaserow',$arr); $smarty->assign('i',$i); $smarty->display('oldrelease.html'); ?>