Xiuno常用的功能实现代码

简单的自定义板块是否首页显示

$fids = array('5','1','2','3','4','6','7'); <!--需要显示在首页的板块ID-->

获取最新会员

<?php $ulist=user_find(array(),array('create_date'=>-1),  $pagesize = 20);?>
<?php foreach($ulist as $_user){ ?>
<a href="<?php echo url("user-$_user[uid]");?>"><img class="avatar-3" src="<?php echo $_user['avatar_url'];?>" title="<?php echo $_user['username'];?>"></a>
<?php echo $_user['username'];?>
<?php } ?>

同板块下相关帖子

function ax_Relevant($fid) 

$r = thread_find(array("fid"=>$fid),array('tid'=>-1),1,6);

return $r;

}

根据id获取帖子详情

function ax_message($tid{

$r = db_find_one('post', array('tid'=>$tid));

//return  xn_substr(strip_tags($r['message_fmt']), 0, 48)."...";  备用截取显示文字数目

return  $r['message_fmt'];

}