kufun
我就是看不明残月那帖啊!您可不可以整理发个手动修改教程啊?现只欠蚊子代码吧了。
hotllus 发表于 2009-11-2 22:45
查找- echo stripslashes( "{"animal":".$newanimal.","animalFood":".$animal[animalfood].","badinfo":[{"mynum":0,"num":0,"type":1}],"items":{"1":{"itemId":".$animal[item1]."},".$animal[item2].$animal[item3].""4":{"itemId":".$animal[item4]."}},"notice":"","serverTime":{"time":".$_SGLOBAL['timestamp']."},"stealflag":{".$touyes."},"task":{"taskFlag":1,"taskId":8},"user":{"exp":".$list[0][mc_exp].","headPic":"".avatar( $_SGLOBAL[supe_uid], "small", TRUE )."","money":".$list[0][money].","uId":".$_SGLOBAL['supe_uid'].","userName":"".$space[name]."","yellowlevel":7,"yellowstatus":0},"weather":{"weatherDesc":"晴天","weatherId":1}}" );
复制代码 替换为- echo stripslashes( "{"animal":".$newanimal.","animalFood":".$animal[animalfood].","badinfo":[{"mynum":".$wenzi_mynum.","num":".$wenzi_num.","type":1}],"items":{"1":{"itemId":".$animal[item1]."},".$animal[item2].$animal[item3].""4":{"itemId":".$animal[item4]."}},"notice":"","serverTime":{"time":".$_SGLOBAL['timestamp']."},"stealflag":{".$touyes."},"task":{"taskFlag":1,"taskId":8},"user":{"exp":".$list[0][mc_exp].","headPic":"".avatar( $_SGLOBAL[supe_uid], "small", TRUE )."","money":".$list[0][money].","uId":".$_SGLOBAL['supe_uid'].","userName":"".$space[name]."","yellowlevel":7,"yellowstatus":0},"weather":{"weatherDesc":"晴天","weatherId":1}}" );
复制代码 查找- $animal = ( array )json_decode( $list[0][animal] );
复制代码 就是上面那段代码的下面第5行,在这代码下加- //wenzi
- $wenzi_num=0;
- $wenzi_mynum=0;
- if ($list[0][wenzi]!=""){
- $wenzi = explode(",",$list[0][wenzi]);
- $wenzi_num = count($wenzi);
-
-
- }
-
-
- //wenzi
复制代码 再往下查找- echo stripslashes( "{"animal":".$newanimal.","animalFood":".$animal[animalfood].","badinfo":[{"mynum":0,"num":0,"type":1}],"items":{"1":{"itemId":".$animal[item1]."},".$animal[item2].$animal[item3].""4":{"itemId":".$animal[item4]."}},"notice":"","serverTime":{"time":".$_SGLOBAL['timestamp']."},"stealflag":{},"task":{"taskFlag":".$taskFlag.","taskId":".$list[0][mc_taskid]."},"user":{"exp":".$list[0][mc_exp].","headPic":"".avatar( $_SGLOBAL[supe_uid], "small", TRUE )."","money":".$list[0][money].","uId":".$_SGLOBAL['supe_uid'].","userName":"".str_replace( "\\u", "\\\\u", unicode_encodegb( $space['name'] ) )."","yellowlevel":7,"yellowstatus":0},"weather":{"weatherDesc":"晴天","weatherId":1}}" );
复制代码 替换为- echo stripslashes( "{"animal":".$newanimal.","animalFood":".$animal[animalfood].","badinfo":[{"mynum":".$wenzi_mynum.","num":".$wenzi_num.","type":1}],"items":{"1":{"itemId":".$animal[item1]."},".$animal[item2].$animal[item3].""4":{"itemId":".$animal[item4]."}},"notice":"","serverTime":{"time":".$_SGLOBAL['timestamp']."},"stealflag":{},"task":{"taskFlag":".$taskFlag.","taskId":".$list[0][mc_taskid]."},"user":{"exp":".$list[0][mc_exp].","headPic":"".avatarmc( $_SGLOBAL[supe_uid], "small", TRUE )."","money":".$list[0][money].","uId":".$_SGLOBAL['supe_uid'].","userName":"".str_replace( "\\u", "\\\\u", unicode_encodegb( $space['name'] ) )."","yellowlevel":7,"yellowstatus":0},"weather":{"weatherDesc":"晴天","weatherId":1}}" );
复制代码 然后在最下面的的上面添加- if ( $_REQUEST['mod'] == "cgi_demolish_pasture" )
- {
- //这里主要是写接受数据并处理数据
- $query = $_SGLOBAL['db']->query( "SELECT money,mc_exp,bad FROM ".tname( "plug_newfarm" )." where uid=".$_SGLOBAL['supe_uid'] );
- while ( $value_me = $_SGLOBAL['db']->fetch_array( $query ) )
- {
- $list_me[] = $value_me;
- }
-
- if ($list_me[0][bad]>24){
- //此处输出使坏次数已满提示
- exit;
- }
- $query = $_SGLOBAL['db']->query( "SELECT money,mc_exp,wenzi FROM ".tname( "plug_newfarm" )." where uid=".intval( $_REQUEST['uId'] ) );
- while ( $value= $_SGLOBAL['db']->fetch_array( $query ) )
- {
- $list[] = $value;
- }
-
- $wenzi_num=0;
- $wenzi_mynum=0;
- $num=0;
- $wenzi_all=$list[0][wenzi];
- if ($wenzi_all!=""){
- $wenzi = explode(",",$list[0][wenzi]);
- $wenzi_num = count($wenzi);
- }
-
-
- if ((intval( $_REQUEST['num'] )+$wenzi_num)<9)
- {
- $num=intval( $_REQUEST['num']);
- }else{
- $num=8-$wenzi_num;
- }
-
- for ($i=0;$i<$num;$i++){
-
- if($wenzi_all=="")
- {
- $wenzi_all=$_SGLOBAL['supe_uid'];
- }else
- {
- $wenzi_all=$wenzi_all.",".$_SGLOBAL['supe_uid'];
- }
-
- }
-
-
-
- $_SGLOBAL['db']->query( "UPDATE ".tname( "plug_newfarm" )." set wenzi='".$wenzi_all."' where uid=".intval( $_REQUEST['uId'] ) );
-
- $_SGLOBAL['db']->query( "UPDATE ".tname( "plug_newfarm" )." set bad=bad+'".$num."' where uid=".$_SGLOBAL['supe_uid'] );
-
- echo "{"cId":1,"leftnum":11,"num":".$num.","total":".($wenzi_num+$num)."}" ;
-
- }
- //拍蚊子
- if ( $_REQUEST['mod'] == "cgi_help_pasture" )
- {
- //这里主要是写接受数据并处理数据
- $query = $_SGLOBAL['db']->query( "SELECT money,mc_exp,wenzi FROM ".tname( "plug_newfarm" )." where uid=".intval( $_REQUEST['uId'] ) );
- while ( $value = $_SGLOBAL['db']->fetch_array( $query ) )
- {
- $list[] = $value;
- }
- //wenzi
- $wenzi_num=0;
- $wenzi_mynum=0;
- if ($list[0][wenzi]!=""){
- $wenzi = explode(",",$list[0][wenzi],2);
- $wenzi_all =$wenzi[1];
- }
-
-
-
-
- $_SGLOBAL['db']->query( "UPDATE ".tname( "plug_newfarm" )." set wenzi='".$wenzi_all."' where uid=".intval( $_REQUEST['uId'] ) );
-
- $_SGLOBAL['db']->query( "UPDATE ".tname( "plug_newfarm" )." set mc_exp=mc_exp+4 where uid=".$_SGLOBAL['supe_uid'] );
- echo "{"addExp":4,"cId":1,"num":1,"pos":".$_REQUEST['pos']."}";
- }
复制代码 试试看. |