這次因為必須在act與fight中共用,因此程式碼只能寫在兩者皆有使用的global.php中
若希望以勞力換取效率的話可以將時間設定與判定的部分(global.php的修改)移至wog_act_group.php和wog_fight_select.php內
[hr]開始修改[hr]
開啟檔案wog/class/wog_act_group.php 寫:In group_fire_list_peo() Function
尋找
- 代碼: 選擇全部
global $DB_site,$_POST,$wog_arry,$lang;
改為
- 代碼: 選擇全部
global $DB_site,$_POST,$wog_arry,$lang[color=red],$fire[/color];
尋找
- 代碼: 選擇全部
if($group_main["g_fire"]==0)
{
alertWindowMsg($lang['wog_act_group_fireset']);
}
改為
- 代碼: 選擇全部
if($group_main["g_fire"]==0 [color=red]&& $fire==0[/color])
{
alertWindowMsg($lang['wog_act_group_fireset']);
}
尋找
- 代碼: 選擇全部
$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");
改為
- 代碼: 選擇全部
if($fire==1)
$group=$DB_site->query("select a.g_id,a.g_name from wog_group_main a where a.g_id<>".$group_main[0]." ");
else
$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");
開啟檔案wog/class/wog_fight_select.php 寫:In fire_group() Function
尋找
- 代碼: 選擇全部
global $DB_site,$_POST,$wogclass,$wog_arry,$lang;
改為
- 代碼: 選擇全部
global $DB_site,$_POST,$wogclass,$wog_arry,$lang[color=red],$fire[/color];
尋找
- 代碼: 選擇全部
$sql="select a.g_a_hp,a.g_a_id,b.g_name,b.g_money from wog_group_area a,wog_group_main b where a.g_id=".$_POST["to_group"]." and a.g_a_type=".$_POST["g_a_type"]." and a.g_id=b.g_id and b.g_fire=1";
改為
- 代碼: 選擇全部
$sql="select a.g_a_hp,a.g_a_id,b.g_fire,b.g_name,b.g_money from wog_group_area a,wog_group_main b where a.g_id=".$_POST["to_group"]." and a.g_a_type=".$_POST["g_a_type"]." and a.g_id=b.g_id";
尋找
- 代碼: 選擇全部
if(!$p)
改為
- 代碼: 選擇全部
if(!$p || ($p['g_fire']==0 [color=red]&& $fire==0[/color]))
開啟檔案wog/forum_support/global.php 寫:尋找
- 代碼: 選擇全部
// end init db
下方,加上
- 代碼: 選擇全部
$begin_d=23; ##begin_day
$end_d =23; ##end_day
$begin_h=0; ##begin_hour
$end_h =24; ##end_hour
$fire=0;
$time_check=explode(',',date("d,H",time()));
if($time_check[0]>=$begin_d && $time_check[0]<=$end_d && $time_check[1]>=$begin_h && $time_check[1]<=$end_h)
$fire=1;
完畢,有任何問題歡迎指教^^