本帖最后由 朋友窝 于 2010-01-21 08:31 编辑
不知道这个行不行,给大家发下,我的改法,
先增加一个JL字段
ALTER TABLE `uchome_happyfarm_config` ADD `jl` int(11) DEFAULT '0'
然后在index.php
搜索这段代码
if ( $_REQUEST['act'] == "nc" )
{
在下面加如下代码即可,因为加每日提醒的话跟你VIP升级有冲突,所以我去掉了!
$Config = $_SGLOBAL['db']->query( "SELECT jl,vip FROM ".tname( "happyfarm_config" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) );
while ( $value = $_SGLOBAL['db']->fetch_array( $Config ) )
{
$list[] = $value;
}
if ( $list[0][vip] == 1 && $list[0][jl] == 0 )
{
$tools = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT tools FROM ".tname( "happyfarm_nc" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) ), 0 );
$tools = json_decode( $tools );
$putonghuafei = 1;
$tools->$putonghuafei = $tools->$putonghuafei + 1;
$tools = json_encode( $tools );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_config" )." set money=money+50,jl=jl+1 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_nc" )." set tools='".$tools."' where uid=".intval( $_SGLOBAL['supe_uid'] ) );
}
if ( $list[0][vip] == 2 && $list[0][jl] == 0 )
{
$tools = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT tools FROM ".tname( "happyfarm_nc" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) ), 0 );
$tools = json_decode( $tools );
$gaosuhuafei = 2;
$tools->$gaosuhuafei = $tools->$gaosuhuafei + 2;
$tools = json_encode( $tools );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_config" )." set money=money+100,jl=jl+1 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_nc" )." set tools='".$tools."',exp=exp+20 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
}
if ( $list[0][vip] == 3 && $list[0][jl] == 0 )
{
$tools = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT tools FROM ".tname( "happyfarm_nc" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) ), 0 );
$tools = json_decode( $tools );
$jisuhuafei = 3;
$tools->$jisuhuafei = $tools->$jisuhuafei + 2;
$tools = json_encode( $tools );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_config" )." set money=money+150,jl=jl+1 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_nc" )." set tools='".$tools."',exp=exp+30 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
}
if ( $list[0][vip] == 4 && $list[0][jl] == 0 )
{
$tools = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT tools FROM ".tname( "happyfarm_nc" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) ), 0 );
$tools = json_decode( $tools );
$jisuhuafei = 3;
$tools->$jisuhuafei = $tools->$jisuhuafei + 3;
$tools = json_encode( $tools );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_config" )." set money=money+200,jl=jl+1 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_nc" )." set tools='".$tools."',exp=exp+40 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
}
if ( $list[0][vip] == 5 && $list[0][jl] == 0 )
{
$tools = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT tools FROM ".tname( "happyfarm_nc" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) ), 0 );
$tools = json_decode( $tools );
$jisuhuafei = 3;
$tools->$jisuhuafei = $tools->$jisuhuafei + 4;
$tools = json_encode( $tools );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_config" )." set money=money+250,jl=jl+1 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_nc" )." set tools='".$tools."',exp=exp+50 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
}
if ( $list[0][vip] == 6 && $list[0][jl] == 0)
{
$tools = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT tools FROM ".tname( "happyfarm_nc" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) ), 0 );
$tools = json_decode( $tools );
$jisuhuafei = 3;
$tools->$jisuhuafei = $tools->$jisuhuafei + 5;
$tools = json_encode( $tools );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_config" )." set money=money+300,jl=jl+1 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_nc" )." set tools='".$tools."',exp=exp+60 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
}
if ( $list[0][vip] == 7 && $list[0][jl] == 0 )
{
$tools = $_SGLOBAL['db']->result( $_SGLOBAL['db']->query( "SELECT tools FROM ".tname( "happyfarm_nc" )." where uid=".intval( $_SGLOBAL['supe_uid'] ) ), 0 );
$tools = json_decode( $tools );
$jisuhuafei = 3;
$tools->$jisuhuafei = $tools->$jisuhuafei + 6;
$tools = json_encode( $tools );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_config" )." set money=money+350,jl=jl+1 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
$_SGLOBAL['db']->query( "UPDATE ".tname( "happyfarm_nc" )." set tools='".$tools."',exp=exp+70 where uid=".intval( $_SGLOBAL['supe_uid'] ) );
} |