[問題] ADR是否能限制特定聯盟進入特定商店??(半成品有)

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
AngeLucifer
星球普通子民
星球普通子民
文章: 21
註冊時間: 2005-05-27 14:55

[問題] ADR是否能限制特定聯盟進入特定商店??(半成品有)

文章 AngeLucifer »

●架設主機作業系統:Linux
●上網方式:Hinet ADSL
●您安裝的程式:cPanel + php + MySql
●您的 phpBB2 版本:phpBB 2.0.15
●您的 domain(網域名稱) :lucifer.kdgl.com.tw
●您的 phpBB2 連結網址:http://72.36.165.146/~worst/phpBB2/index.php
●錯誤代碼:無

●ADR版本:v0.3.4

如題,
小弟我所架的phpBB ADR並沒有限制特定聯盟進入特定商店的功能,
(如A聯盟只能進入A商店跟B商店, B聯盟只能進入C商店與D商店)
但是沒有此一功能限制的話便會遊戲性盡失......

所以想在這裡請教一下各位是否有相關的mod可以解決??
最後由 AngeLucifer 於 2005-06-04 00:45 編輯,總共編輯了 1 次。
AngeLucifer
星球普通子民
星球普通子民
文章: 21
註冊時間: 2005-05-27 14:55

文章 AngeLucifer »

以下是我在某個國外的留言版發問得到的回答:

Hello (hum japanese guy cool )

It have made a thing quite similar but it's a zone specific store. But it will be easy to modify this, if you know PHP.

My mod is still in the DEV party of this board because i don't have the time now to make an install file

http://www.phpbb-adr.com/adr/viewtopic. ... 9941#19941


這位網友說他曾做了一個與我的要求相當相似的mod, 不過是"特定區域的商店",

但如果懂php的話應該能輕易地修改這個install檔案.

以下則是他說的相似的install檔:

代碼: 選擇全部

# 
#-----[ Open ]------------------------------------------ 
# 


adr_shops.php 


# 
#-----[ Find et replace ]------------------------------------------ 
# 
  


case 'save_new_shop' : 

         $adr_general = adr_get_general_config(); 

         adr_substract_points( $user_id , $adr_general['new_shop_price'] , adr_shops , '?mode=create_shop' ); 

         $sql = "SELECT * FROM " . ADR_SHOPS_TABLE ." 
            ORDER BY shop_id 
            DESC LIMIT 1"; 
         $result = $db->sql_query($sql); 
         if( !$result ) 
         { 
            message_die(GENERAL_ERROR, 'Could not obtain alignments information', "", __LINE__, __FILE__, $sql); 
         } 
         $fields_data = $db->sql_fetchrow($result); 

         $shop_name = ( isset($HTTP_POST_VARS['shop_name']) ) ? trim($HTTP_POST_VARS['shop_name']) : trim($HTTP_GET_VARS['shop_name']); 
         $shop_desc = ( isset($HTTP_POST_VARS['shop_desc']) ) ? trim($HTTP_POST_VARS['shop_desc']) : trim($HTTP_GET_VARS['shop_desc']); 
         $shop_id = $fields_data['shop_id'] +1; 
          
       
         if ( !$shop_name ) 
         { 
            message_die(MESSAGE, $lang['Fields_empty']); 
         } 

         $sql = "INSERT INTO " . ADR_SHOPS_TABLE . " 
            ( shop_id , shop_name , shop_desc ,  shop_owner_id, shop_zone ) 
            VALUES ( $shop_id ,'" . str_replace("\'", "''", $shop_name) . "','" . str_replace("\'", "''", $shop_desc) . "',  $user_id, $actual_zone )"; 
         $result = $db->sql_query($sql); 
         if( !$result ) 
         { 
            message_die(GENERAL_ERROR, "Couldn't insert new shop", "", __LINE__, __FILE__, $sql); 
         } 

         adr_previous ( Adr_users_shops_create_success , adr_shops , '' );    
         break; 


# 
#-----[ Find et replace ]------------------------------------------ 
# 


case 'view_store_list' : 

         $template->assign_block_vars('view_store_list',array()); 

          
         $zone_name = $info['zone_name']; 
         // All user view stores and zone restriction by ced 
         $sql = "SELECT * FROM " . ADR_STORES_TABLE . " 
               WHERE store_admin = 0 
               AND (store_zone = '$zone_name'  ||  store_zone = 0 ) 
               ORDER BY store_name ASC "; 
         $result = $db->sql_query($sql); 
         if( !$result ) 
         { 
            message_die(GENERAL_ERROR, 'Could not obtain custom store info', "", __LINE__, __FILE__, $sql); 
         } 

         if ( $row = $db->sql_fetchrow($result) ) 
         { 
            $i = 0; 
            do 
            { 
               $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; 

               if ( $row['store_status'] == 1 ) 
               { 
                  $store_status = $lang['Adr_store_open']; 
               } 
               else 
               { 
                  $store_status = $lang['Adr_store_closed']; 
               } 

               if ( $row['store_img'] != '' ) 
               { 
                  $store_img = '<img src="adr/images/store/' . $row['store_img'] . '">'; 
               } 
               else 
               { 
                  $store_img = ''; 
               } 

               $template->assign_block_vars('view_store_list.store', array( 
                  "ROW_CLASS" => $row_class, 
                  "STORE_NAME" => $row['store_name'], 
                  "STORE_DESC" => $row['store_desc'], 
                  "STORE_IMG" => $store_img, 
                  "STORE_STATUS" => $store_status, 
                  "U_STORE_NAME" => append_sid("adr_shops.$phpEx?mode=view_store&shop_id=".$row[ 'store_id']), 
               )); 

               $i++; 
            } 
            while ( $row = $db->sql_fetchrow($result) ); 
         } 
          
         if ( $userdata['user_level'] == ADMIN )       
         { 
            // Admin only stores 
            $sql = "SELECT * FROM " . ADR_STORES_TABLE . " 
                  WHERE store_admin = 1 
                     ORDER BY store_name ASC "; 
            $result = $db->sql_query($sql); 
            if( !$result ) 
            { 
               message_die(GENERAL_ERROR, 'Could not obtain custom store info', "", __LINE__, __FILE__, $sql); 
            } 

            if ( $admin = $db->sql_fetchrow($result) ) 
            { 
               $i = 0; 
               do 
               { 
                  $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; 

                  if ( $admin['store_img'] != '' ) 
                  { 
                     $store_img = '<img src="adr/images/store/' . $admin['store_img'] . '">'; 
                  } 

                  if ( $admin['store_img'] == '' ) 
                  { 
                     $store_img = ''; 
                  } 

                  if ( $admin['store_admin'] == 1 ) 
                  { 
                     $store_auth = $lang['Adr_store_admin']; 
                  } 

                  $template->assign_block_vars('view_store_list.admin', array( 
                     "ROW_CLASS" => $row_class, 
                     "STORE_NAME" => $admin['store_name'], 
                     "STORE_DESC" => $admin['store_desc'], 
                     "STORE_IMG" => $admin['store_img'], 
                     "STORE_STATUS" => $store_auth, 
                     "U_STORE_NAME" => append_sid("adr_shops.$phpEx?mode=view_store_admin"), 
                  )); 

                  $i++; 
               } 
               while ( $row = $db->sql_fetchrow($result) ); 
            } 
         } 

         $template->assign_vars(array( 
            "L_STORE_NAME" => $lang['Adr_store_name'], 
            "L_STORE_DESC" => $lang['Adr_store_desc'], 
            "L_STORE_IMG" => $lang['Adr_store_img'], 
            "L_STORE_STATUS" => $lang['Adr_store_status'], 
            "L_STORE_ADMIN" => $lang['Adr_store_admin'] 
         )); 

         break; 





雖然那位網友說很容易,

不過小弟我實在不知道從何改起......

所以想麻煩各位指點一下,

如何修改這個"半成品"?? :-o
主題已鎖定

回到「外掛問題討論」