[外掛](V3.0)工會頭銜系統

版主: 涅魂, 簫哥

風之雲
 
文章: 6
註冊時間: 2007-06-03 12:41 pm

[外掛](V3.0)工會頭銜系統

文章風之雲 » 2007-06-03 5:17 pm

涅魂 大大 那個好像不適合V3.0
所以我改了涅魂 大大那個-0-"
所以我只是修改的..

在您的資料庫中輸入下列語法

代碼: 選擇全部
CREATE TABLE `wog_group_style` (
`g_id` INT( 10 ) UNSIGNED NOT NULL ,
`g_s_lv` SMALLINT( 2 ) UNSIGNED DEFAULT '0' NOT NULL ,
`g_s_name` VARCHAR( 10 ) NOT NULL
);
ALTER TABLE `wog_player` ADD `p_g_lv` SMALLINT( 2 ) UNSIGNED DEFAULT '0' NOT NULL ;


開啟檔案wog/wog.js
尋找
代碼: 選擇全部
p_group="",

在它後面加上
代碼: 選擇全部
p_style="",

尋找
代碼: 選擇全部
function act_click(f,a,b)

改成
代碼: 選擇全部
function act_click(f,a,b,c)

尋找
代碼: 選擇全部
thisfrom.temp_id.value=b;

後面,加上
代碼: 選擇全部
thisfrom.temp_id2.value=c;

尋找
代碼: 選擇全部
f.write('<tr><td><input type="button" value="認領會員" onClick="parent.act_click(\'group\',\'get_member\')"></td><td class=b1><--核准入會申請<會長專用></td></tr>');

後面,加上
代碼: 選擇全部
   f.write('<tr><td><input type="button" value="頭銜授予" onClick="parent.act_click(\'group\',\'set_style_view\')"></td><td class=b1><--授予頭銜給會員<會長專用></td></tr>');
   f.write('<tr><td><input type="button" value="頭銜設定" onClick="parent.act_click(\'group\',\'style\')"></td><td class=b1><--設定所有的頭銜<會長專用></td></tr>');

尋找
代碼: 選擇全部
function group_p_act(temp_d,morale,number)

前面,加上
代碼: 選擇全部
function group_style_view(temp,page)
{
   var f=parent.wog_view.document;
   message_cls();
   f.write(temp_table1);
   f.write('<form action="wog_act.php" method="post" target="mission">');
   if(!page)
   {
      f.write('<tr><td width=10%>位階排行</td><td width=60%>名稱</td><td width=30%>更改</td></tr>');
      var s1=temp.split(";");
      for(var a=0;a<10;a++)
      {
         if(s1[a])
         {
            s2=s1[a].split(",");
            f.write('<tr><td>'+s2[1]+'</td><td>'+s2[0]+'</td><td><input type="button" value="修改" onClick="parent.act_click(\'group\',\'chang_style\','+s2[1]+')"><input type="button" value="刪除" onClick="parent.act_click(\'group\',\'removal_style\','+s2[1]+')"></td></tr>');
         }else
         {
            var b=a+1;
            f.write('<tr><td>'+b+'</td><td>未設定</td><td><input type="button" value="修改" onClick="parent.act_click(\'group\',\'chang_style\','+b+')"></td></tr>');
         }
      }
   }else
   {
      f.write('<tr><td width=10%>位階排行</td><td width=60%>名稱</td><td width=30%>更改</td></tr>');
      s=temp.split(",");
      f.write('<tr><td>'+s[1]+'</td><td><input type="text" name="chang" value="'+s[0]+'"></td><td><input type=button value="修改" onClick="parent.act_click(\'group\',\'save_style\',this.form.chang.value,'+s[1]+')"></td></tr>');
      f.write('<input type="hidden" name="level" value="'+s[1]+'">');
   }
   f.write('</form>');
   f.write(temp_table2);
}
function group_style_set_view(temp,page,player)
{
   var f=parent.wog_view.document;
   message_cls();
   f.write(temp_table1);
   f.write('<form action="wog_act.php" method="post" target="mission">');
   if(!page)
   {
      f.write('<tr><td width=60%>會員名稱</td><td width=10%>頭銜有無</td><td width=30%>頭銜</td></tr>');
      var s1=temp.split(";");
      for(var a=0;a<s1.length;a++)
      {
         var s2=s1[a].split(",");
         if(s2[2]==0){var p_style="無";}else{var p_style="有";}
         f.write('<tr><td>'+s2[1]+'</td><td>'+p_style+'</td><td><input type="button" value="授與" onClick="parent.act_click(\'group\',\'set_style_chang\','+s2[0]+')"><input type="button" value="取消" onClick="parent.act_click(\'group\',\'set_style_removal\','+s2[0]+')"></td></tr>');
      }

   }else
   {
      f.write('<tr><td width=10%>名稱</td><td width=60%>選擇頭銜</td><td width=30%>更改</td></tr>');
      f.write('<tr><td>'+player+'</td><td><select name="set_style">');
      var s1=temp.split(";");
      for(var a=0;a<s1.length;a++)
      {
         var s2=s1[a].split(",");
         if(s2[2]){var p_check="style='background-color:#ffff00'";}else{var p_check="";}
         f.write('<option value='+s2[1]+' '+p_check+'>'+s2[0]+'</option>');
      }
      f.write('</select></td><td><input type=submit value="修改"></td></tr>');
      f.write('<input type="hidden" name="f" value="group">');
      f.write('<input type="hidden" name="act" value="set_style_save">');
      f.write('<input type="hidden" name="p_name" value="'+player+'">');
   }
   f.write('</form>');
   f.write(temp_table2);
}

尋找
代碼: 選擇全部
'+p_group+'<br>

後面,加上
代碼: 選擇全部
'+p_style+'<br>

開啟檔案wog/wog_act.php
尋找
代碼: 選擇全部
         case "save_book":
            $wog_act_class->group_book_save($HTTP_COOKIE_VARS["wog_cookie"]);
         break;

後面,加上
代碼: 選擇全部
   case "style":
                $wog_act_class->group_style_view($HTTP_COOKIE_VARS["wog_cookie"]);
            break;
            case "chang_style":
                $wog_act_class->group_style_chang($HTTP_COOKIE_VARS["wog_cookie"]);
            break;
            case "save_style":
                $wog_act_class->group_style_save($HTTP_COOKIE_VARS["wog_cookie"]);
            break;
            case "set_style_view":
                $wog_act_class->group_style_set_view($HTTP_COOKIE_VARS["wog_cookie"]);
            break;
            case "set_style_chang":
                $wog_act_class->group_style_set_chang($HTTP_COOKIE_VARS["wog_cookie"]);
            break;
            case "set_style_save":
                $wog_act_class->group_style_set_save($HTTP_COOKIE_VARS["wog_cookie"]);
            break;
            case "set_style_removal":
                $wog_act_class->group_style_set_removal($HTTP_COOKIE_VARS["wog_cookie"]);
            break;
            case "removal_style":
                $wog_act_class->group_style_removal($HTTP_COOKIE_VARS["wog_cookie"]);
            break;

開啟檔案wog/class/wog_act_group.php
尋找
代碼: 選擇全部
}
?>

前面,加上
代碼: 選擇全部
   function group_style_view($user_id)
   {
      global $DB_site,$_POST,$wog_arry,$lang;
      $group=$DB_site->query_first("select p_g_id from wog_player where p_id=".$user_id."");
      if($group['p_g_id']==0){alertWindowMsg($lang['wog_act_group_nogroup']);}
      $group=$DB_site->query_first("select a.g_id,a.g_adm_id1 from wog_group_main a,wog_player b where a.g_id=b.p_g_id and b.p_id=".$user_id."");
      if($group['g_adm_id1']!=$user_id){alertWindowMsg($lang['wog_act_group_nolyadmin']);}
      $group2=$DB_site->query("select g_s_lv,g_s_name from wog_group_style where g_id=".$group[g_id]." order by g_s_lv asc");
      while($styles=$DB_site->fetch_array($group2))
      {
         $s.=";".stripslashes($styles[g_s_name]).",".$styles[g_s_lv];
      }
      $s=substr($s,1,strlen($s));
      showscript("parent.group_style_view('$s')");
      unset($group);
      unset($group2);
       
   }
   function group_style_chang($user_id)
   {
      global $DB_site,$wog_arry,$lang;
       
      $p_group=$DB_site->query_first("select p_g_id from wog_player where p_id=".$user_id."");
      $group=$DB_site->query_first("select g_s_lv,g_s_name from wog_group_style where g_s_lv=".$_POST['temp_id']." and g_id=".$p_group[p_g_id]."");
      if(!$group){$s=",".$_POST['temp_id'];}else{$s=stripslashes($group[g_s_name]).",".$group[g_s_lv];}
      showscript("parent.group_style_view('$s',1)");
      unset($group);
       
   }
   function group_style_save($user_id)
   {
      global $DB_site,$_POST,$wog_arry,$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){alertWindowMsg($lang['wog_act_group_nogroup']);}
      if($user_id!=$group_main["g_adm_id1"]){alertWindowMsg($lang['wog_act_group_nolyadmin']);}
      $g_id=$group_main['g_id'];
      $chang=$_POST["temp_id"];
      $group=$DB_site->query_first('select g_s_lv from wog_group_style where g_s_lv='.$_POST["temp_id2"].' and g_id='.$g_id);
       
      if($group)
      {
         $DB_site->query('update wog_group_style set g_s_name="'.addslashes($chang).'" where g_id='.$g_id.' and g_s_lv='.$_POST["temp_id2"]);
      }else
      {
         $DB_site->query("insert wog_group_style(g_id,g_s_lv,g_s_name)values(".$g_id.",".$_POST["temp_id2"].",'".addslashes($chang)."')");
      }
      $this->group_style_view($user_id);
   }
   function group_style_set_view($user_id)
   {
      global $DB_site,$lang;
      $group_main=$DB_site->query_first("select a.g_id,a.g_adm_id1 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']);}
      $temp_s="";
      $get_peo=$DB_site->query("select p_id,p_name,p_g_lv from wog_player where p_g_id=".$group_main['g_id']." ");
      while($list_peo=$DB_site->fetch_array($get_peo))
      {
         $temp_s.=";".$list_peo["p_id"].",".$list_peo["p_name"].",".$list_peo["p_g_lv"];
      }
      if(!$temp_s){alertWindowMsg('玩家等級不足,無法授予頭銜。');}
      $temp_s=substr($temp_s,1,strlen($temp_s));
      showscript("parent.group_style_set_view('$temp_s')");
      unset($temp_s);
      unset($group_main);
      unset($list_peo);
   }
   function group_style_set_chang($user_id)
   {
      global $DB_site,$_POST,$lang;
      if(!$_POST['temp_id']){alertWindowMsg('請選擇會員');}
      $player=$DB_site->query_first("select p_id,p_g_id,p_g_lv from wog_player where p_id=".$_POST['temp_id']."");
      if(!$player){alertWindowMsg('該玩家不存在');}
      $style=$DB_site->query("select g_s_name,g_s_lv from wog_group_style where g_id=".$player[p_g_id]."");
      while($style_get=$DB_site->fetch_array($style))
      {
         $style_list.=";".$style_get["g_s_name"].",".$style_get["g_s_lv"];
         if($player['p_g_lv']==$style_get['g_s_lv']){$style_list.=",CHECKED";}
      }
      $style_list=substr($style_list,1,strlen($style_list));
      if(!$style_list){alertWindowMsg('沒有設定封號');}
      showscript("parent.group_style_set_view('$style_list',1,'$player[p_id]')");
      unset($temp_s);
      unset($player);
      unset($style_list);
   }
   function group_style_set_save($user_id)
   {
      global $DB_site,$_POST,$wog_arry,$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){alertWindowMsg($lang['wog_act_group_nogroup']);}
      if($user_id!=$group_main["g_adm_id1"]){alertWindowMsg($lang['wog_act_group_nolyadmin']);}
      $g_id=$group_main['g_id'];
      $set_style=$_POST["set_style"];
      $DB_site->query('update wog_player set p_g_lv='.$set_style.' where p_id='.$_POST["p_name"].'');
      $this->group_style_set_view($user_id);
   }
   function group_style_set_removal($user_id)
   {
      global $DB_site,$_POST,$wog_arry,$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){alertWindowMsg($lang['wog_act_group_nogroup']);}
      if($user_id!=$group_main["g_adm_id1"]){alertWindowMsg($lang['wog_act_group_nolyadmin']);}
      $g_id=$group_main['g_id'];
      $p_removal=$_POST["temp_id"];
      $DB_site->query('update wog_player set p_g_lv=0 where p_id='.$p_removal.'');
      $this->group_style_set_view($user_id);
   }
   function group_style_removal($user_id)
   {
      global $DB_site,$_POST,$wog_arry,$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){alertWindowMsg($lang['wog_act_group_nogroup']);}
      if($user_id!=$group_main["g_adm_id1"]){alertWindowMsg($lang['wog_act_group_nolyadmin']);}
      $g_id=$group_main['g_id'];
      $s_removal=$_POST["temp_id"];

      $DB_site->query('delete from wog_group_style where g_id='.$g_id.' and g_s_lv='.$s_removal.'');
      $this->group_style_view($user_id);
   }

開啟檔案wog/class/wog_act_chara.php
尋找
代碼: 選擇全部
if($s==1)

前面,加上這兩句
代碼: 選擇全部
$p_style=$DB_site->query_first("select a.g_s_name from wog_group_style a,wog_player b where  a.g_id=b.p_g_id and a.g_s_lv=b.p_g_lv and b.p_id=".$user_id."");


代碼: 選擇全部
echo "parent.p_style='".$p_style["g_s_name"]."';";




儲存,關閉所有檔案。 [quote="涅魂"]<u>積分 +3</u>

修復外掛

at 2007-06-03 08:36 pm[/point]


最後由 風之雲 於 2007-06-03 10:09 pm 編輯,總共編輯了 2 次。


涅魂
 
文章: 4463
註冊時間: 2004-01-04 11:17 am
來自: Taiwan
性別: 男生

文章涅魂 » 2007-06-03 8:35 pm

版規規定,文章請勿發表在外掛區與精華區

這兩區是蒐藏文章用的,不是發文用的喔

而這個外掛我原先是想要重寫成比較好利用的類型所以才沒修正原文章

不過還是謝謝您的幫忙,收下積分吧^^


圖檔

風之雲
 
文章: 6
註冊時間: 2007-06-03 12:41 pm

文章風之雲 » 2007-06-03 9:58 pm

涅魂 寫:版規規定,文章請勿發表在外掛區與精華區

這兩區是蒐藏文章用的,不是發文用的喔

而這個外掛我原先是想要重寫成比較好利用的類型所以才沒修正原文章

不過還是謝謝您的幫忙,收下積分吧^^


抱歉...
小弟雖然很久來過這裡
但這時才注冊
還沒看板規...

下次不會再犯了

不用謝謝

我也是看見有人改不了

我才改的

但好像我改錯- -"

有會員說開不到公會...

大大能幫我看看吧

我的wog

http://windcloud.no-ip.info/wog/


- -不用了..我發現了是wog/class/wog_act_chara.php

這個問題..更新了...




回到 外掛區

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 2 位訪客

cron