Ignore:
Timestamp:
2007/07/24 21:57:44 (17 years ago)
Author:
adati
Message:

1.4.2betaのマージ

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/beta/data/include/module.inc

    r8 r15120  
    11<?php 
    22 
    3 // ¥¿¥°½ÐÎÏÍÑ¥¯¥é¥¹ 
     3// ¥¨¥Ó¥¹¥¿¥°½ÐÎÏÍÑ¥¯¥é¥¹ 
    44class LC_EbisPage { 
    5     function LC_EbisPage() { 
    6         $this->tpl_mainpage = MODULE_PATH . "ebis_tag_text.tpl"; 
    7     } 
     5    function LC_EbisPage() { 
     6        $this->tpl_mainpage = MODULE_PATH . "mdl_ebis_tag/ebis_tag_text.tpl"; 
     7    } 
    88} 
    99 
     
    1111function sfPrintEbisTag($pid = "") { 
    1212    $objQuery = new SC_Query(); 
    13     $arrRet = $objQuery->select("sub_data", "dtb_module", "module_id = ?", array(EBIS_TAG_MID)); 
     13    $arrRet   = $objQuery->select("sub_data", "dtb_module", "module_id = ?", array(EBIS_TAG_MID)); 
    1414    $arrSubData = unserialize($arrRet[0]['sub_data']); 
    15     $arrEbis = array(); 
    16      
    17     if($arrSubData['cid'] != "") { 
    18         $arrEbis['cid'] = $arrSubData['cid']; 
    19     } else { 
    20         return; 
    21     } 
    22      
    23     // ¡Ö/¡×¤¬½ÅÊ£¤·¤Æ¤¤¤ë¤â¤Î¤Ø¤ÎÂбþ 
    24     $php_self = ereg_replace("[/]+", "/", $_SERVER['PHP_SELF']); 
    25     // PHP¥Õ¥¡¥¤¥ë¤Î¸å¤í¤Ë¡Ö/¡×¤¬¤Ä¤¤¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¤â¤Î¤Ø¤ÎÂбþ 
    26     $php_self = ereg_replace(".php[/]+$", ".php", $php_self); 
    27      
     15     
     16    if ( empty($arrSubData['cid']) ) return; 
     17     
     18    $arrEbis = array( 
     19        'cid'       => $arrSubData['cid'], 
     20        'login_url' => $arrSubData['login_url'], 
     21    ); 
     22     
    2823    if(!is_array($pid) && $pid != "") { 
    2924        if(!ereg(".tpl$", $pid)) { 
     
    3227        } else { 
    3328            // ¥Æ¥ó¥×¥ì¡¼¥È¤Î¥Ñ¥¹¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¾ì¹ç 
    34             $temp_id = ereg_replace(HTML_PATH,"",$pid);          
    35             $temp_id = ereg_replace("^[/]+","",$temp_id); 
    36             $temp_id = ereg_replace(".tpl$","",$temp_id); 
    37             $temp_id = ereg_replace("[\./]","_",$temp_id); 
     29            $temp_id = str_replace(USER_TEMPLATE_PATH, '', $pid); 
     30            $temp_id = str_replace(HTML_PATH,   '',  $temp_id); 
     31            $temp_id = preg_replace('|^/+|',    '',  $temp_id); 
     32            $temp_id = preg_replace('|\.tpl$|', '',  $temp_id); 
     33            $temp_id = preg_replace('|[\./]|',  '_', $temp_id); 
    3834            $arrEbis['pid'] = $temp_id; 
    3935        } 
     
    5147        $arrEbis['pid'] = ereg_replace("detail.php\?product_id=", "detail-p", $filename); 
    5248    } 
    53      
     49 
     50    // ¹ØÆþ´°Î»¥Ú¡¼¥¸(thanks¥Ú¡¼¥¸)¤ÏÆüìID¤òȯ¹Ô 
     51    lfSetThanksPegeTag($arrEbis, $arrSubData); 
     52 
    5453    // ID³ä¤êÅö¤Æ¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤Ï¡¢¼«Æ°Åª¤ËÀ¸À®¤¹¤ë¡£ 
    5554    if($arrEbis['pid'] == "") {              
     
    5958        $arrEbis['pid'] = $temp_id; 
    6059    } 
    61              
     60 
    6261    // ¥Ú¡¼¥¸ID¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¥¿¥°¤ò½ÐÎϤ¹¤ë¡£ 
    6362    if($arrEbis['pid'] != "") { 
     
    6867        $objSubView->display($objSubPage->tpl_mainpage); 
    6968    } 
     69} 
     70 
     71// ¹ØÆþ´°Î»²èÌ̤Υ¨¥Ó¥¹¥¿¥°¤òÀßÄê 
     72function lfSetThanksPegeTag(&$arrEbis, $arrSubData){ 
     73    $pattern = "|/shopping/complete.php$|"; 
     74    $target  = $_SERVER["REQUEST_URI"]; 
     75    if( !preg_match($pattern, $target) ) return; 
     76     
     77    global $arrEBiSTagAttrTagName; 
     78    global $arrJobEN; 
     79    global $arrSexEN; 
     80    global $order_id; 
     81     
     82    $objQuery = new SC_Query(); 
     83    $arrRet   = $objQuery->select('*', 'dtb_order', 'order_id = ?', array($order_id)); 
     84    $arrCustomerInfo = $arrRet[0]; 
     85    $arrEbis['pid']  = 'thanks'; // ¥Ú¡¼¥¸ID¤ò¥»¥Ã¥È 
     86     
     87    /** 
     88     * $arrSubData == Array ( 
     89     *      [user] => username 
     90     *      [pass] => password 
     91     *      [login_url] => http://login_url/ 
     92     *      [cid] => ebis_parameter 
     93     *      [m1id] => 1 
     94     *      [a1id] => 2 
     95     *      [o1id] => 3 
     96     *      [o2id] => 4 
     97     *      [o3id] => 0 
     98     *      [o4id] => 0 
     99     *      [o5id] => 0 
     100     * ) 
     101     * $arrEBiSTagAttrTagName == Array( 
     102     *      'm1id', 'a1id', 'o1id', 'o2id' 
     103     *      'o3id', 'o4id', 'o5id' 
     104     * ) 
     105     **/ 
     106     
     107    foreach ($arrEBiSTagAttrTagName as $tagname) { 
     108        if ( empty($arrSubData[$tagname]) ) continue; 
     109         
     110        $value = $arrSubData[$tagname]; 
     111         
     112        // °À­¾ðÊó¤ò¥»¥Ã¥È 
     113        switch ($value) { 
     114        case EBiS_TAG_ATTR_CUSTOMER_ID: 
     115            $arrEbis[$tagname] = $arrCustomerInfo['customer_id']; 
     116            break; 
     117        case EBiS_TAG_ATTR_PAYMENT: 
     118            $arrEbis[$tagname] = $arrCustomerInfo['payment_total']; 
     119            break; 
     120        case EBiS_TAG_ATTR_JOB: 
     121            if ( empty($arrCustomerInfo['order_job']) ) break; 
     122            $arrEbis[$tagname] = $arrJobEN[$arrCustomerInfo['order_job']]; 
     123            break; 
     124        case EBiS_TAG_ATTR_SEX: 
     125            $arrEbis[$tagname] = $arrSexEN[$arrCustomerInfo['order_sex']]; 
     126            break; 
     127        case EBiS_TAG_ATTR_AGE: 
     128            if ( empty($arrCustomerInfo['order_birth']) ) break; 
     129            $arrEbis[$tagname] = gfGetAge($arrCustomerInfo['order_birth']); 
     130            break; 
     131        case EBiS_TAG_ATTR_IS_CUSTOMER: 
     132            if ( $arrCustomerInfo['customer_id'] == '0' ) { 
     133                $arrEbis[$tagname] = '0'; 
     134            } else { 
     135                $arrEbis[$tagname] = '1'; 
     136            } 
     137            break; 
     138        default: 
     139        } 
     140    } 
    70141} 
    71142 
Note: See TracChangeset for help on using the changeset viewer.