麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
帮帮忙啊
悬赏分:20 - 2007年06月01日

<?
include('../include/News.php');
include('../include/TurnPage.php');
include('../include/SwitchKind.php');
$news = new News();

$lines = 20;
if (strlen($keyword) > 0)
{
$cond = "where (title like binary '%$keyword%') or (body like binary '%$keyword%')";
}
else
{
if (strlen($kind) > 0)
$cond = "where kind ='$kind' order by id desc";
else
$cond = "order by id desc";
}

$tp = new TurnPage('zjdy' , "select * from news ".$cond, $page, $lines,
"index.php", "kind=$kind&keyword=$keyword");
$cond = $cond.$tp->getCurLimit();

$l = $news->getElements($cond);
$l2 = $news->getElements("order by id desc limit 0 ,5");
$t = new Tpl();
$t->set_file('index', 'index.tpl');

$t->set_block('index', 'row', 'rows');
for ($i=0; $i<$l->getSize(); $i++)
{
$item = $l->getAt($i);
$t->set_var('id', $item[0]);
$t->set_var('title', $item[1]);
$t->set_var('picture', $item[3]);
$t->set_var('update_time', substr($item[4],0,10));
$nowtime = time();
$strtotime = strtotime($update_time);
$days = "1";
$dayseconds = "86400";
$iii = "$days*$dayseconds";
$ttt = "$nowtime-$strtotime";
if($ttt<$iii)
{
$t->set_var('new', '[New]');
}
$t->parse('rows', 'row', true);
}

$t->set_block('index', 'top10', 'top10s');
for ($i = 0; $i<$l2->getSize(); $i++)
{
$item = $l2->getAt($i);
$t->set_var('top10_id', $item[0]);
$t->set_var('top10_title', $item[1]);
$t->parse('top10s', 'top10', true);
}

$l3 = $news->getElements("order by comment_nums desc limit 0 ,5");
$t->set_block('index', 'top20', 'top20s');
for ($i = 0; $i<$l3->getSize(); $i++)
{
$item = $l3->getAt($i);
$t->set_var('top20_id', $item[0]);
$t->set_var('top20_title', $item[1]);
$t->parse('top20s', 'top20', true);
}

$t->set_var('tmp_kind',SwitchKind($kind));
$t->set_var('kind',$kind);
$t->set_var('first',$tp->getFirst());
$t->set_var('pre',$tp->getPre());
$t->set_var('next',$tp->getNext());
$t->set_var('last',$tp->getLast());
$t->set_var('page',$tp->getPage());
$t->set_var('pages',$tp->getPages());
$t->set_var('count', $tp->getCount());
$t->parse('out', 'index');
$t->p('out');

?>

现在要加上如果KIND=16,则输出有图片的,
怎么做啊,帮我改改啊,谢谢

提问者:wo38   06-01 16:04
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
18 + 4 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM