PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/neutrino atomic edition 08/ext/list/list.php

http://neutrino-cms.googlecode.com/
PHP | 33 lines | 29 code | 3 blank | 1 comment | 13 complexity | b9d5498862e2f3430dc343f3b74efd75 MD5 | raw file
 1<?php
 2// ??????? ?? ????????
 3$ext_ini=@parse_ini_file('ext/list/list.ini.php');
 4$ppp=@$ext_ini['ppp']?$ext_ini['ppp']:20;
 5
 6if($posts = getapts()){
 7
 8	rsort($posts);
 9	$pages = sizeof($posts) / $ppp;
10	$skip = (isset($_v['skip']) && is_numeric($_v['skip']) ? $_v['skip'] : 0);
11	if (sizeof($posts) > $ppp) $posts = array_slice($posts, $skip, $ppp);
12	foreach ($posts as $p) if(is_numeric($p)) {
13		$post = post_info($p);
14		$post_id = $post['id'] + $_s['time_offset'];
15		$post['admenu']=admenu($p);
16		if (!@trim($post['title'])) $post['title']=$_l['notitle'];
17		$moretitle = "";
18		if(@gbuffer($post['id'],"close")) @$moretitle .= $_l['close_title'];
19			if(@gbuffer($p,"close") && !ADMIN) {} 
20			else echo '<p class="li">  <a href="'.generate_link('p='.$p).'#post">'.$post['title'].'</a> <span class="meta">'.$post['admenu'].$moretitle.' <a href="'.generate_link('p='.$p).'#comment">'.$_l['comments']." ".$post['c_count'].'</a> <span class="date">'.$post['date'].'</span></span></p>';
21	}
22
23	if ($pages > 1){
24		$j=1;
25		while($j <= $pages){
26			$pn = $j + 1;
27			if ($j*$ppp==$skip)$pages_link .= '<a href="'.generate_link('ext=list&skip='.$j*$ppp).'"><strong>'.$pn.'</strong></a> ';
28			else $pages_link .= '<a href="'.generate_link('ext=list&skip='.$j*$ppp).'">'.$pn.'</a> ';
29			$j++;
30		}
31		if($pages_link) echo '<a href="'.generate_link('ext=list').'">1</a> '.$pages_link;
32	}
33}