1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2007 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | //デフォルトページ |
---|
8 | $GLOBALS['__Framework']['default_page'] = 'fh_calendar_week'; |
---|
9 | |
---|
10 | //<PCKTAI |
---|
11 | if (!OPENPNE_ENABLE_KTAI) { |
---|
12 | // disable ktai module |
---|
13 | exit; |
---|
14 | } |
---|
15 | //> |
---|
16 | |
---|
17 | // User-Agent判別 |
---|
18 | if (CHECK_KTAI_UA && !isKtaiUserAgent()) { |
---|
19 | openpne_redirect('pc'); |
---|
20 | } |
---|
21 | |
---|
22 | // IPアドレスチェック |
---|
23 | if (CHECK_KTAI_IP) { |
---|
24 | require_once 'Net/IPv4.php'; |
---|
25 | $is_valid_ip = false; |
---|
26 | for ($i = 0; $i < count($GLOBALS['_OPENPNE_KTAI_IP_LIST']); $i++) { |
---|
27 | if (Net_IPv4::ipInNetwork($_SERVER['REMOTE_ADDR'], $GLOBALS['_OPENPNE_KTAI_IP_LIST'][$i]) |
---|
28 | || Net_IPv4::ipInNetwork($_SERVER['HTTP_X_FORWARDED_FOR'], $GLOBALS['_OPENPNE_KTAI_IP_LIST'][$i])) { |
---|
29 | $is_valid_ip = true; |
---|
30 | break; |
---|
31 | } |
---|
32 | } |
---|
33 | |
---|
34 | if (!$is_valid_ip) { |
---|
35 | openpne_redirect('pc'); |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | // bizモジュールディレクトリの定義 |
---|
40 | $biz_dir = OPENPNE_MODULES_BIZ_DIR.'/biz/'; |
---|
41 | // bizモジュールライブラリ |
---|
42 | require_once $biz_dir . 'lib/smarty_functions.php'; |
---|
43 | require_once $biz_dir . 'lib/mysql_functions.php'; |
---|
44 | |
---|
45 | // 文字コード変換 |
---|
46 | function ktai_biz_convert_encoding($arr) |
---|
47 | { |
---|
48 | return is_array($arr) ? |
---|
49 | array_map('ktai_biz_convert_encoding', $arr) : |
---|
50 | mb_convert_encoding($arr, 'UTF-8', 'SJIS-win'); |
---|
51 | } |
---|
52 | |
---|
53 | $agent = new OpenPNE_KtaiUA(); |
---|
54 | if ($agent->is_docomo()) { |
---|
55 | $GLOBALS['__Framework']['carrier'] = 'i'; |
---|
56 | } elseif ($agent->is_au()) { |
---|
57 | $GLOBALS['__Framework']['carrier'] = 'e'; |
---|
58 | } elseif ($agent->is_vodafone()) { |
---|
59 | $GLOBALS['__Framework']['carrier'] = 's'; |
---|
60 | } |
---|
61 | |
---|
62 | // 絵文字変換 |
---|
63 | function ktai_biz_convert_emoji($arr) |
---|
64 | { |
---|
65 | return is_array($arr) ? |
---|
66 | array_map('ktai_biz_convert_emoji', $arr) : |
---|
67 | emoji_escape($arr); |
---|
68 | } |
---|
69 | |
---|
70 | function ktai_biz_convert($arr) |
---|
71 | { |
---|
72 | $arr = ktai_biz_convert_emoji($arr); |
---|
73 | $arr = ktai_biz_convert_encoding($arr); |
---|
74 | return $arr; |
---|
75 | } |
---|
76 | |
---|
77 | $_GET = ktai_biz_convert($_GET); |
---|
78 | $_POST = ktai_biz_convert($_POST); |
---|
79 | $_REQUEST = ktai_biz_convert($_REQUEST); |
---|
80 | |
---|
81 | ini_set('session.use_cookies', '0'); |
---|
82 | |
---|
83 | function init_ktai_biz_page(&$smarty) |
---|
84 | { |
---|
85 | //---- inc_ テンプレート用 変数 ----// |
---|
86 | $smarty->assign('inc_ktai_header', fetch_inc_ktai_header()); |
---|
87 | $smarty->assign('inc_ktai_footer', fetch_inc_ktai_footer()); |
---|
88 | |
---|
89 | //全ページ共通変数のアサイン |
---|
90 | $smarty->assign('msg', k_p_common_msg4msg_id($_REQUEST['msg'])); |
---|
91 | $smarty->assign('WORD_FRIEND', WORD_FRIEND); |
---|
92 | $smarty->assign('WORD_MY_FRIEND', WORD_MY_FRIEND); |
---|
93 | $smarty->assign('WORD_FRIEND_HALF', WORD_FRIEND_HALF); |
---|
94 | $smarty->assign('WORD_MY_FRIEND_HALF', WORD_MY_FRIEND_HALF); |
---|
95 | $smarty->assign('ktai_color_config', db_select_c_sns_config_ktai()); |
---|
96 | |
---|
97 | $is_secure = $GLOBALS['__Framework']['is_secure']; |
---|
98 | |
---|
99 | if ($is_secure) { |
---|
100 | $smarty->assign('u', $GLOBALS['KTAI_C_MEMBER_ID']); |
---|
101 | $smarty->assign('tail', $GLOBALS['KTAI_URL_TAIL']); |
---|
102 | @session_start(); |
---|
103 | $smarty->assign('PHPSESSID', session_id()); |
---|
104 | } |
---|
105 | |
---|
106 | // set SJIS |
---|
107 | $smarty->setOutputCharset('SJIS'); |
---|
108 | } |
---|
109 | |
---|
110 | ?> |
---|