本帖最后由 liuzhly 于 2009-12-9 20:45 编辑
我是从我的代码抽出一部分功能告诉你如下:
农场 plug_newfarm 增加字段,类型 int ,
在UChome/newfarm.php
改成,红色是增加的
}else{
$date_no = intval(date('Ymd')); //每天登陆时候更新数据,数据归零、农场日志清理
$_SGLOBAL['db']->query( "update ".tname( "plug_newfarm" )." set login_time={$date_no} where uid=".$_SGLOBAL['supe_uid']." and login_time<>{$date_no}" );
}
$_TPL['titles'] = array(
$space['username'],
"开心农场"
);
然后打开
newfarmjson.php ,找到显示好友的
if ( $_REQUEST['mod'] == "friend" ){ //[=4=]
if ( $_REQUEST['false'] == "refresh" ){
echo "{\"code\":0}";
exit( );
}
类似这里,代码我自己整理了,有可能不和你们一样
找到
$query = $_SGLOBAL['db']->query( "SELECT uid,exp,money,charm FROM ".tname( "plug_newfarm" )." WHERE uid IN (".$space[friend].$_SGLOBAL['supe_uid'].")" );
替换成
$date_no = intval(date('Ymd')); //格式化日期,类型 20091209
$query = $_SGLOBAL['db']->query( "SELECT uid,exp,money,charm FROM ".tname( "plug_newfarm" )." WHERE uid IN (".$space[friend].$_SGLOBAL['supe_uid'].") and {$date_no}-click_time<=3" );
这样查询,就去掉了那些超过3天的人了...
向改自己参照说明改改吧,农产文件现在乱套了,想用自己的会改~~~ |