source: branches/rel/data/include/module.inc @ 12157

Revision 12157, 3.4 KB checked in by uehara, 17 years ago (diff)
Line 
1<?php
2
3// ¥¿¥°½ÐÎÏÍÑ¥¯¥é¥¹
4class LC_EbisPage {
5    function LC_EbisPage() {
6        $this->tpl_mainpage = MODULE_PATH . "ebis_tag_text.tpl";
7    }
8}
9
10// ¥¨¥Ó¥¹¥¿¥°¤Îȯ¹Ô
11function sfPrintEbisTag($pid = "") {
12    $objQuery = new SC_Query();
13    $arrRet = $objQuery->select("sub_data", "dtb_module", "module_id = ?", array(EBIS_TAG_MID));
14    $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   
28    if(!is_array($pid) && $pid != "") {
29        if(!ereg(".tpl$", $pid)) {
30            // ¥Ú¡¼¥¸ID¤ò¾å½ñ¤­¤¹¤ë
31            $arrEbis['pid'] = $pid;
32        } else {
33            // ¥Æ¥ó¥×¥ì¡¼¥È¤Î¥Ñ¥¹¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¾ì¹ç
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);
38            $arrEbis['pid'] = $temp_id;
39        }
40    }   
41   
42    // ¾¦ÉÊ°ìÍ÷¥Ú¡¼¥¸¤Ï¡¢ÆüìID¤òȯ¹Ô
43    if(ereg("/products/list.php\?category_id=[0-9]+$", $_SERVER["REQUEST_URI"])) {
44        $filename = basename($_SERVER["REQUEST_URI"]);
45        $arrEbis['pid'] = ereg_replace("list.php\?category_id=", "list-c", $filename);
46    }
47   
48    // ¾¦Éʾܺ٥ڡ¼¥¸¤Ï¡¢ÆüìID¤òȯ¹Ô
49    if(ereg("/products/detail.php\?product_id=[0-9]+$", $_SERVER["REQUEST_URI"])) {
50        $filename = basename($_SERVER["REQUEST_URI"]);
51        $arrEbis['pid'] = ereg_replace("detail.php\?product_id=", "detail-p", $filename);
52    }
53   
54    // ID³ä¤êÅö¤Æ¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ú¡¼¥¸¤Ï¡¢¼«Æ°Åª¤ËÀ¸À®¤¹¤ë¡£
55    if($arrEbis['pid'] == "") {             
56        $temp_id = ereg_replace("^[/]+","",$_SERVER['PHP_SELF']);
57        $temp_id = ereg_replace(".php$","",$temp_id);
58        $temp_id = ereg_replace("[\./]","_",$temp_id);
59        $arrEbis['pid'] = $temp_id;
60    }
61           
62    // ¥Ú¡¼¥¸ID¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ß¥¿¥°¤ò½ÐÎϤ¹¤ë¡£
63    if($arrEbis['pid'] != "") {
64        $objSubPage = new LC_EbisPage();
65        $objSubPage->arrEbis = $arrEbis;
66        $objSubView = new SC_SiteView();
67        $objSubView->assignobj($objSubPage);
68        $objSubView->display($objSubPage->tpl_mainpage);
69    }
70}
71
72// ¥³¥ó¥Ð¡¼¥¸¥ç¥ó¥¿¥°¤Îȯ¹Ô
73function sfPrintAffTag($conv_page, $option) {
74    if(is_numeric($conv_page)) {
75        // sub_data¤è¤ê¥¿¥°¾ðÊó¤òÆɤ߹þ¤à
76        $objQuery = new SC_Query();
77        $arrRet = $objQuery->select("sub_data", "dtb_module", "module_id = ?", array(AFF_TAG_MID));
78        $arrSubData = unserialize($arrRet[0]['sub_data']);
79        $aff_tag = $arrSubData[$conv_page];
80       
81        $array = split("\|", $option);
82       
83        // ÆÃÄêʸ»ú¤ÎÃÖ¤­´¹¤¨
84        foreach($array as $each) {
85            list($key, $value) = split("=", $each);
86            $aff_tag = ereg_replace("\[\[" . $key . "\]\]", $value, $aff_tag);
87        }
88        print($aff_tag);       
89    }
90}
91
92// dtb_payment¤ËÈÆÍѹàÌܤ¬Â¸ºß¤·¤Æ¤¤¤Ê¤±¤ì¤ÐÄɲ乤ë
93function sfAlterMemo(){
94    $objQuery = new SC_Query();
95   
96    // ÈÆÍѹàÌܤθºß¥Á¥§¥Ã¥¯
97    if(!sfColumnExists("dtb_payment", "memo01")){
98       
99        // ¥â¥¸¥å¡¼¥ëID¤òÄɲÃ
100        $objQuery->query("alter table dtb_payment add module_id int4;");
101       
102        // ¥â¥¸¥å¡¼¥ë¥Ñ¥¹¤òÄɲÃ
103        $objQuery->query("alter table dtb_payment add module_path text;");
104       
105        // ÈÆÍѹàÌܤò10¸ÄÄɲÃ
106        for($i=1; $i<=9; $i++){
107            $objQuery->query("alter table dtb_payment add memo0".$i." text;");
108        }
109        $objQuery->query("alter table dtb_payment add memo10 text;");
110    }
111}
112
113?>
Note: See TracBrowser for help on using the repository browser.