📄 wog_act_group.php
字号:
<?
/*=====================================================
Copyright (C) ETERNAL<cqz78@qq.com>
Modify : 2005/01/01
URL : http://zqkls.uu1001.com/thread.php?fid=49
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
===================================================== */
class wog_act_group{
function group_fire_set($user_id)
{
global $DB_site,$_POST,$lang;
$group_main=$DB_site->query_first("select a.g_id,a.g_adm_id1,a.g_adm_id2,a.g_fire_time from wog_group_main a,wog_player b where a.g_id=b.p_g_id and b.p_id=".$user_id);
if(!$group_main)
{
alertWindowMsg($lang['wog_act_group_nogroup']);
}
if($user_id!=$group_main["g_adm_id1"])
{
alertWindowMsg($lang['wog_act_group_nolyadmin']);
}
if($group_main["g_fire_time"]+(60*60*2)>time())
{
alertWindowMsg($lang['wog_act_group_nochang']);
}
$DB_site->query("update wog_group_main set g_fire=".$_POST["temp_id2"].",g_fire_time=".time()." where g_id=".$group_main["g_id"]);
$this->group_center($user_id);
unset($group_main);
}
function group_news($user_id)
{
global $DB_site,$lang;
$group_main=$DB_site->query_first("select a.g_id from wog_group_main a,wog_player b where a.g_id=b.p_g_id and b.p_id=".$user_id."");
if(!$group_main)
{
alertWindowMsg($lang['wog_act_group_nogroup']);
}
$DB_site->query("delete from wog_group_event where g_b_dateline < ".(time()-(10*24*60*60))." ");
$sql="select g_b_body,g_b_dateline from wog_group_event where g_b_id=".$group_main[g_id]." order by g_b_inid desc LIMIT 10";
$pack=$DB_site->query($sql);
$s="";
while($packs=$DB_site->fetch_array($pack))
{
$s=$s.";".$packs[g_b_body].",".date("Y/m/d g:i a",$packs[g_b_dateline]);
}
$s=substr($s,1,strlen($s));
$DB_site->free_result($pack);
showscript("parent.system_view('$s')");
unset($s);
unset($packs);
}
function group_fire_list_peo($user_id)
{
global $DB_site,$_POST,$wog_arry,$lang;
$time=time();
$g_f_t=date("G",$time);
if($g_f_t<$wog_arry["g_f_stime"] || $g_f_t>=$wog_arry["g_f_etime"])
{
alertWindowMsg($lang['wog_act_group_firetime'].$wog_arry["g_f_stime"].":00-".$wog_arry["g_f_etime"].":00");
}
$group_main=$DB_site->query_first("select a.g_id,a.g_fire from wog_group_main a,wog_player b where a.g_id=b.p_g_id and b.p_id=".$user_id."");
if(!$group_main)
{
alertWindowMsg($lang['wog_act_group_nogroup']);
}
if($group_main["g_fire"]==0)
{
alertWindowMsg($lang['wog_act_group_fireset']);
}
$temp_s="";
$u_g_a=$DB_site->query_first("select p_name,p_g_number,p_g_morale,p_g_a_id from wog_player a,wog_group_area b where a.p_id=".$user_id." ");
if($u_g_a)
{
$g_a_type=$DB_site->query_first("select g_a_type from wog_group_area where g_a_id=".$u_g_a["p_g_a_id"]."");
if(!$g_a_type)
{
$g_a_type[0]="7";
}
$temp_s.=";".$u_g_a["p_name"].",".$u_g_a["p_g_morale"].",".$u_g_a["p_g_number"].",".$g_a_type[0];
}
$temp_s=substr($temp_s,1,strlen($temp_s));
$group=$DB_site->query("select a.g_id,a.g_name from wog_group_main a where a.g_id<>".$group_main[0]." and g_fire=1");
$temp_ss="";
while($groups=$DB_site->fetch_array($group))
{
$temp_ss.=";".$groups[0].",".$groups[1];
}
$DB_site->free_result($group);
unset($groups);
$temp_ss=substr($temp_ss,1,strlen($temp_ss));
showscript("parent.group_fire_list_peo('".$temp_s."','".$temp_ss."')");
unset($temp_s);
unset($temp_ss);
unset($u_g_a);
}
function group_money($user_id)
{
global $DB_site,$_POST,$lang;
if(empty($_POST["temp_id"]))
{
alertWindowMsg($lang['wog_act_nomoney']);
}
if(!is_numeric($_POST["temp_id"]) || (int)$_POST["temp_id"] < 1)
{
alertWindowMsg($lang['wog_act_errmoney']);
}
$_POST["temp_id"]=(int)$_POST["temp_id"];
$group_main=$DB_site->query_first("select p_money,p_g_id from wog_player where p_id=".$user_id." ");
if($group_main["p_g_id"]==0)
{
alertWindowMsg($lang['wog_act_group_nogroup']);
}
if($group_main["p_money"]<$_POST["temp_id"])
{
alertWindowMsg($lang['wog_act_nomoney']);
}
$DB_site->query("update wog_group_main set g_money=g_money+".$_POST["temp_id"]." where g_id=".$group_main["p_g_id"]);
$DB_site->query("update wog_player set p_money=p_money-".$_POST["temp_id"]." where p_id=".$user_id);
showscript("parent.job_end(15)");
unset($group);
}
function group_hp($user_id)
{
global $DB_site,$_POST,$wog_arry,$lang;
$group_main=$DB_site->query_first("select a.g_id,a.g_money,b.p_g_a_id,c.g_a_hp,c.g_a_dateline,b.p_smart from wog_group_main a,wog_player b,wog_group_area c where a.g_id=b.p_g_id and b.p_id=".$user_id." and c.g_a_id=b.p_g_a_id ");
if(!$group_main)
{
alertWindowMsg($lang['wog_act_group_nogroup']);
}
if($group_main["g_a_dateline"]+(60*$wog_arry["g_ea_time"]) > time())
{
alertWindowMsg($lang['wog_act_group_needmin'].$wog_arry["g_ea_time"]." minutes");
}
if($group_main["g_money"]<1000)
{
alertWindowMsg($lang['wog_act_group_needmoney']);
}
$g_hp=rand(1,round(($p["p_smart"]/1500)*15))+10;
$g_hp=$g_hp+$group_main["g_a_hp"];
if($g_hp>100){$g_hp=100;}
$DB_site->query("update wog_group_area set g_a_hp=$g_hp where g_a_id=".$group_main["p_g_a_id"]);
$DB_site->query("update wog_group_main set g_money=g_money-1000 where g_id=".$group_main["g_id"]);
$this->group_center($user_id);
unset($group);
}
function group_del($user_id)
{
global $DB_site,$_POST,$lang;
$group_main=$DB_site->query_first("select a.g_id,a.g_adm_id1,a.g_adm_id2 from wog_group_main a,wog_player b where a.g_id=b.p_g_id and b.p_id=".$user_id);
if($group_main)
{
if($user_id==$group_main["g_adm_id1"])
{
$DB_site->query("delete from wog_group_main where g_id=".$group_main["g_id"]."");
$DB_site->query("delete from wog_group_area where g_id=".$group_main["g_id"]."");
$DB_site->query("delete from wog_group_event where g_b_id=".$group_main["g_id"]."");
$DB_site->query("delete from wog_group_book where g_id=".$group_main["g_id"]."");
$DB_site->query("update wog_player set p_g_id=0,p_g_a_id=0,p_g_number=0,p_g_morale=0 where p_g_id=".$group_main["g_id"]."");
}else
{
$DB_site->query("update wog_group_main set g_peo=g_peo-1 where g_id=".$group_main["g_id"]."");
$DB_site->query("update wog_player set p_g_id=0,p_g_a_id=0,p_g_number=0,p_g_morale=0 where p_id=".$user_id."");
}
showscript("parent.p_group='';parent.job_end(15)");
}
unset($group);
}
function group_get_save_member($user_id)
{
global $DB_site,$_POST,$lang;
if(empty($_POST["temp_id2"]))
{
alertWindowMsg($lang['wog_act_group_nosel']);
}
$_POST["temp_id2"]=htmlspecialchars($_POST["temp_id2"]);
$group_main=$DB_site->query_first("select a.g_id,a.g_adm_id1,a.g_adm_id2 from wog_group_main a,wog_player b where a.g_id=b.p_g_id and b.p_id=".$user_id."");
if(!$group_main)
{
alertWindowMsg($lang['wog_act_group_nogroup']);
}
if($group_main["g_adm_id1"]!=$user_id && $group_main["g_adm_id2"]!=$user_id)
{
alertWindowMsg($lang['wog_act_group_nolv']);
}
$group=$DB_site->query_first("select g_id,p_id from wog_group_join where g_j_id=".$_POST["temp_id2"]);
if(!$group)
{
alertWindowMsg($lang['wog_act_group_cancel']);
}
if($group_main["g_id"]!=$group["g_id"])
{
alertWindowMsg($lang['wog_act_group_notset']);
}
$p=$DB_site->query_first("select p_g_id from wog_player where p_id=".$group["p_id"]);
if($p["p_g_id"]>0)
{
alertWindowMsg($lang['wog_act_group_havgroup']);
}
$p_count=$DB_site->query_first("select g_peo from wog_group_main where g_id=".$group["g_id"]."");
if($p_count[0]>=20)
{
alertWindowMsg($lang['wog_act_group_ful']);
}
$DB_site->query("update wog_player set p_g_id=".$group["g_id"].",p_g_number=1000,p_g_morale=100 where p_id=".$group["p_id"]."");
$DB_site->query("update wog_group_main set g_peo=g_peo+1 where g_id=".$group["g_id"]."");
$DB_site->query("delete from wog_group_join where p_id=".$group["p_id"]);
showscript("parent.job_end(15)");
unset($group);
unset($p_count);
unset($p);
unset($group_main);
}
function group_get_member($user_id)
{
global $DB_site,$_POST,$lang;
$DB_site->query("delete from wog_group_join where g_j_dateline < ".(time()-(7*24*60*60)));
$group_main=$DB_site->query_first("select a.g_id,a.g_adm_id1,a.g_adm_id2 from wog_group_main a,wog_player b where a.g_id=b.p_g_id and b.p_id=".$user_id."");
if(!$group_main)
{
alertWindowMsg($lang['wog_act_group_nogroup']);
}
if($group_main["g_adm_id1"]!=$user_id && $group_main["g_adm_id2"]!=$user_id)
{
alertWindowMsg($lang['wog_act_group_nolv']);
}
$group=$DB_site->query("select a.g_j_id,b.p_name,b.p_lv,c.ch_name from wog_group_join a,wog_player b,wog_character c where a.g_id=".$group_main["g_id"]." and a.p_id=b.p_id and b.ch_id=c.ch_id order by a.g_j_dateline asc");
$temp_s="";
while($groups=$DB_site->fetch_array($group))
{
$temp_s.=";".$groups[0].",".$groups[1].",".$groups[2].",".$groups[3];
}
$DB_site->free_result($group);
unset($groups);
$temp_s=substr($temp_s,1,strlen($temp_s));
showscript("parent.group_join_list('$temp_s')");
unset($temp_s);
}
function group_add($user_id)
{
global $DB_site,$_POST,$lang;
if(empty($_POST["g_id"]))
{
alertWindowMsg($lang['wog_act_group_nogroup']);
}
$_POST["g_id"]=htmlspecialchars($_POST["g_id"]);
$DB_site->query("delete from wog_group_join where g_j_dateline < ".(time()-(7*24*60*60)));
$group=$DB_site->query_first("select p_g_id from wog_player where p_id=".$user_id." ");
if($group[0]!=0)
{
$group_chk=$DB_site->query_first("select g_id from wog_group_main where g_id=".$group[0]." ");
if($group_chk)
{
alertWindowMsg($lang['wog_act_group_havgroup']);
}else
{
$DB_site->query("update wog_player set p_g_id=0,p_g_a_id=0,p_g_number=0,p_g_morale=0 where p_id=".$user_id."");
}
unset($group_chk);
}
$group=$DB_site->query_first("select g_peo from wog_group_main where g_id=".$_POST["g_id"]."");
if($group[0]>=20)
{
alertWindowMsg($lang['wog_act_group_ful']);
}
$group=$DB_site->query_first("select g_j_id from wog_group_join where p_id=".$user_id." and g_id=".$_POST["g_id"]."");
if($group)
{
alertWindowMsg($lang['wog_act_group_post']);
}
$DB_site->query("insert into wog_group_join(g_id,p_id,g_j_dateline)values(".$_POST["g_id"].",".$user_id.",".time().")");
showscript("parent.job_end(14)");
unset($group);
}
function group_join($user_id)
{
global $DB_site,$_POST,$lang;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -