Nucleus CMS日本語版SVNをgit-svnしたもの。リポジトリの変換作業用
Revision | 4d524fbab4622bbd43335f2add27eb96e1c17aed (tree) |
---|---|
Time | 2007-03-27 20:50:10 |
Author | kimitake <kimitake@1ca2...> |
Commiter | kimitake |
rolled back...
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/branches/branch-3-2@243 1ca29b6e-896d-4ea0-84a5-967f57386b96
@@ -1,36 +1,37 @@ | ||
1 | 1 | <?php |
2 | 2 | /* |
3 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | - * Copyright (C) 2002-2007 The Nucleus Group | |
5 | - * | |
6 | - * This program is free software; you can redistribute it and/or | |
7 | - * modify it under the terms of the GNU General Public License | |
8 | - * as published by the Free Software Foundation; either version 2 | |
9 | - * of the License, or (at your option) any later version. | |
10 | - * (see nucleus/documentation/index.html#license for more info) | |
3 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | + * Copyright (C) 2002-2005 The Nucleus Group | |
5 | + * | |
6 | + * This program is free software; you can redistribute it and/or | |
7 | + * modify it under the terms of the GNU General Public License | |
8 | + * as published by the Free Software Foundation; either version 2 | |
9 | + * of the License, or (at your option) any later version. | |
10 | + * (see nucleus/documentation/index.html#license for more info) | |
11 | 11 | */ |
12 | 12 | |
13 | 13 | /** |
14 | - * File containing actions that can be performed by visitors of the site, | |
15 | - * like adding comments, etc... | |
14 | + * File containing actions that can be performed by visitors of the site, | |
15 | + * like adding comments, etc... | |
16 | 16 | * @license http://nucleuscms.org/license.txt GNU General Public License |
17 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
18 | - * @version $Id: action.php,v 1.4.2.2 2007-03-27 11:26:50 kimitake Exp $ | |
19 | - * $NucleusJP: action.php,v 1.7 2007/02/04 06:28:44 kimitake Exp $ | |
20 | - */ | |
17 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
18 | + * @version $Id: action.php,v 1.4.2.3 2007-03-27 11:50:10 kimitake Exp $ | |
19 | + * @version $NucleusJP: action.php,v 1.4.2.1 2005/08/23 08:08:37 kimitake Exp $ | |
20 | + */ | |
21 | 21 | |
22 | -$CONF = array(); | |
23 | -include('./config.php'); | |
24 | 22 | |
25 | -// common functions | |
23 | +$CONF = array(); | |
24 | +include('./config.php'); // common functions | |
26 | 25 | include_once($DIR_LIBS . 'ACTION.php'); |
27 | 26 | |
28 | 27 | $action = requestVar('action'); |
28 | + | |
29 | 29 | $a =& new ACTION(); |
30 | 30 | $errorInfo = $a->doAction($action); |
31 | 31 | |
32 | -if ($errorInfo) { | |
33 | - doError($errorInfo['message'], new SKIN($errorInfo['skinid']) ); | |
32 | +if ($errorInfo) | |
33 | +{ | |
34 | + doError($errorInfo['message'], new SKIN($errorInfo['skinid'])); | |
34 | 35 | } |
35 | 36 | |
36 | -?> | |
\ No newline at end of file | ||
37 | +?> |
@@ -1,24 +1,25 @@ | ||
1 | 1 | <?php |
2 | + | |
2 | 3 | /* |
3 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | - * Copyright (C) 2002-2007 The Nucleus Group | |
5 | - * | |
6 | - * This program is free software; you can redistribute it and/or | |
7 | - * modify it under the terms of the GNU General Public License | |
8 | - * as published by the Free Software Foundation; either version 2 | |
9 | - * of the License, or (at your option) any later version. | |
10 | - * (see nucleus/documentation/index.html#license for more info) | |
4 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
5 | + * Copyright (C) 2002-2005 The Nucleus Group | |
6 | + * | |
7 | + * This program is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GNU General Public License | |
9 | + * as published by the Free Software Foundation; either version 2 | |
10 | + * of the License, or (at your option) any later version. | |
11 | + * (see nucleus/documentation/index.html#license for more info) | |
11 | 12 | */ |
12 | 13 | |
13 | 14 | /** |
14 | - * Nucleus Atom Syndication | |
15 | + * Nucleus Atom Syndication | |
15 | 16 | * @license http://nucleuscms.org/license.txt GNU General Public License |
16 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
17 | - * @version $Id: atom.php,v 1.4.2.2 2007-03-27 11:26:50 kimitake Exp $ | |
18 | - * $NucleusJP: atom.php,v 1.7 2007/02/04 06:28:44 kimitake Exp $ | |
19 | - */ | |
17 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
18 | + * @version $Id: atom.php,v 1.4.2.3 2007-03-27 11:46:50 kimitake Exp $ | |
19 | + * @version $NucleusJP: atom.php,v 1.4.2.1 2005/08/23 08:08:37 kimitake Exp $ | |
20 | + */ | |
20 | 21 | |
21 | -header('Pragma: no-cache'); | |
22 | +header("Pragma: no-cache"); | |
22 | 23 | |
23 | 24 | $CONF = array(); |
24 | 25 | $CONF['Self'] = 'atom.php'; |
@@ -30,17 +31,17 @@ if (!$CONF['DisableSite']) { | ||
30 | 31 | ob_start(); |
31 | 32 | selectSkin('feeds/atom'); |
32 | 33 | selector(); |
33 | - $feed = ob_get_contents(); | |
34 | + $feed = ob_get_contents(); | |
34 | 35 | ob_end_clean(); |
35 | - | |
36 | + | |
36 | 37 | // create ETAG (hash of feed) |
37 | 38 | // (HTTP_IF_NONE_MATCH has quotes around it) |
38 | - $eTag = '"' . md5($feed) . '"'; | |
39 | - header('Etag: ' . $eTag); | |
40 | - | |
39 | + $eTag = '"'.md5($feed).'"'; | |
40 | + header('Etag: '.$eTag); | |
41 | + | |
41 | 42 | // compare Etag to what we got |
42 | - if ($eTag == serverVar('HTTP_IF_NONE_MATCH') ) { | |
43 | - header('HTTP/1.0 304 Not Modified'); | |
43 | + if ($eTag == serverVar('HTTP_IF_NONE_MATCH')) { | |
44 | + header("HTTP/1.0 304 Not Modified"); | |
44 | 45 | header('Content-Length: 0'); |
45 | 46 | } else { |
46 | 47 | $feed = mb_convert_encoding($feed, "UTF-8", "EUC-JP"); |
@@ -48,7 +49,7 @@ if (!$CONF['DisableSite']) { | ||
48 | 49 | // dump feed |
49 | 50 | echo $feed; |
50 | 51 | } |
51 | - | |
52 | + | |
52 | 53 | } |
53 | 54 | |
54 | -?> | |
\ No newline at end of file | ||
55 | +?> |
@@ -33,6 +33,6 @@ if (!@file_exists($DIR_LIBS . 'globalfunctions.php')) { | ||
33 | 33 | // include libs |
34 | 34 | include($DIR_LIBS.'globalfunctions.php'); |
35 | 35 | if (!extension_loaded('mbstring')) { |
36 | - include($DIR_LIBS.'mb_emulator/mb-emulator.php'); | |
36 | +include($DIR_LIBS.'mb_emulator/mb-emulator.php'); | |
37 | 37 | } |
38 | 38 | ?> |
\ No newline at end of file |
@@ -37,4 +37,4 @@ | ||
37 | 37 | |
38 | 38 | </form> |
39 | 39 | </body> |
40 | -</html> | |
\ No newline at end of file | ||
40 | +</html> |
@@ -1,29 +1,29 @@ | ||
1 | 1 | <?php |
2 | 2 | /* |
3 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | - * Copyright (C) 2002-2007 The Nucleus Group | |
5 | - * | |
6 | - * This program is free software; you can redistribute it and/or | |
7 | - * modify it under the terms of the GNU General Public License | |
8 | - * as published by the Free Software Foundation; either version 2 | |
9 | - * of the License, or (at your option) any later version. | |
10 | - * (see nucleus/documentation/index.html#license for more info) | |
3 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | + * Copyright (C) 2002-2005 The Nucleus Group | |
5 | + * | |
6 | + * This program is free software; you can redistribute it and/or | |
7 | + * modify it under the terms of the GNU General Public License | |
8 | + * as published by the Free Software Foundation; either version 2 | |
9 | + * of the License, or (at your option) any later version. | |
10 | + * (see nucleus/documentation/index.html#license for more info) | |
11 | 11 | */ |
12 | 12 | /** |
13 | - * This script allows adding items to Nucleus through bookmarklets. The member must be logged in | |
14 | - * in order to use this. | |
15 | - * | |
13 | + * This script allows adding items to Nucleus through bookmarklets. The member must be logged in | |
14 | + * in order to use this. | |
15 | + * | |
16 | 16 | * @license http://nucleuscms.org/license.txt GNU General Public License |
17 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
18 | - * @version $Id: bookmarklet.php,v 1.3.2.2 2007-03-27 11:26:59 kimitake Exp $ | |
19 | - * $NucleusJP: bookmarklet.php,v 1.9 2007/02/04 06:28:45 kimitake Exp $ | |
20 | - */ | |
17 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
18 | + * @version $Id: bookmarklet.php,v 1.3.2.3 2007-03-27 11:46:58 kimitake Exp $ | |
19 | + * @version $NucleusJP: bookmarklet.php,v 1.3.2.1 2005/08/23 08:08:37 kimitake Exp $ | |
20 | + */ | |
21 | 21 | |
22 | 22 | // bookmarklet is part of admin area (might need XML-RPC) |
23 | 23 | $CONF = array(); |
24 | 24 | $CONF['UsingAdminArea'] = 1; |
25 | 25 | |
26 | -// include all classes and config data | |
26 | +// include all classes and config data | |
27 | 27 | include('../config.php'); |
28 | 28 | |
29 | 29 | $action = requestVar('action'); |
@@ -33,76 +33,61 @@ if ($action == 'contextmenucode') { | ||
33 | 33 | exit; |
34 | 34 | } |
35 | 35 | |
36 | -if (!$member->isLoggedIn() ) { | |
36 | +if (!$member->isLoggedIn()) { | |
37 | 37 | bm_loginAndPassThrough(); |
38 | 38 | exit; |
39 | 39 | } |
40 | 40 | |
41 | 41 | // on successfull login |
42 | -if ( ($action == 'login') && ($member->isLoggedIn() ) ) { | |
42 | +if (($action == 'login') && ($member->isLoggedIn())) | |
43 | 43 | $action = requestVar('nextaction'); |
44 | -} | |
45 | - | |
46 | -if ($action == '') { | |
44 | +if ($action == '') | |
47 | 45 | $action = 'add'; |
48 | -} | |
49 | - | |
50 | -sendContentType('application/xhtml+xml', 'bookmarklet-' . $action); | |
46 | + | |
47 | +sendContentType('application/xhtml+xml', 'bookmarklet-'.$action); | |
51 | 48 | |
52 | 49 | // check ticket |
53 | 50 | $action = strtolower($action); |
54 | 51 | $aActionsNotToCheck = array('login', 'add', 'edit'); |
55 | - | |
56 | -if (!in_array($action, $aActionsNotToCheck) ) { | |
57 | - | |
58 | - if (!$manager->checkTicket() ) { | |
52 | +if (!in_array($action, $aActionsNotToCheck)) | |
53 | +{ | |
54 | + if (!$manager->checkTicket()) | |
59 | 55 | bm_doError(_ERROR_BADTICKET); |
60 | - } | |
56 | +} | |
61 | 57 | |
62 | -} | |
63 | 58 | |
64 | 59 | // find out what to do |
65 | 60 | switch ($action) { |
66 | - // adds the item for real | |
67 | 61 | case 'additem': |
68 | - bm_doAddItem(); | |
62 | + bm_doAddItem(); // adds the item for real | |
69 | 63 | break; |
70 | - | |
71 | - // shows the edit item form | |
72 | 64 | case 'edit': |
73 | - bm_doEditForm(); | |
65 | + bm_doEditForm(); // shows the edit item form | |
74 | 66 | break; |
75 | - | |
76 | - // edits the item for real | |
77 | - case 'edititem': | |
67 | + case 'edititem': // edits the item for real | |
78 | 68 | bm_doEditItem(); |
79 | 69 | break; |
80 | - | |
81 | - // on login, 'action' gets changed to 'nextaction' | |
82 | - case 'login': | |
70 | + case 'login': // on login, 'action' gets changed to 'nextaction' | |
83 | 71 | bm_doError('Something went wrong'); |
84 | 72 | break; |
85 | - | |
86 | - // shows the fill in form | |
87 | 73 | case 'add': |
88 | 74 | default: |
89 | - bm_doShowForm(); | |
75 | + bm_doShowForm(); // shows the fill in form | |
90 | 76 | break; |
91 | 77 | } |
92 | - | |
78 | + | |
93 | 79 | function bm_doAddItem() { |
94 | 80 | global $member, $manager, $CONF; |
95 | - | |
81 | + | |
96 | 82 | $manager->loadClass('ITEM'); |
97 | 83 | $result = ITEM::createFromRequest(); |
98 | - | |
99 | - if ($result['status'] == 'error') { | |
84 | + | |
85 | + if ($result['status'] == 'error') | |
100 | 86 | bm_doError($result['message']); |
101 | - } | |
102 | 87 | |
103 | 88 | $blogid = getBlogIDFromItemID($result['itemid']); |
104 | 89 | $blog =& $manager->getBlog($blogid); |
105 | - | |
90 | + | |
106 | 91 | if ($result['status'] == 'newcategory') { |
107 | 92 | $message = 'アイテムは追加され、新しいカテゴリーが作成されました。 <a href="index.php?action=categoryedit&blogid='.$blogid.'&catid='.$result['catid'].'" onclick="if (event && event.preventDefault) event.preventDefault(); window.open(this.href); return false;" title="Opens in new window">ここをクリックしてカテゴリーの名前と説明を編集してください。</a>'; |
108 | 93 | $extrahead = ''; |
@@ -114,55 +99,52 @@ function bm_doAddItem() { | ||
114 | 99 | $message = _ITEM_ADDED; |
115 | 100 | $extrahead = ''; |
116 | 101 | } |
117 | - | |
102 | + | |
118 | 103 | bm_message(_ITEM_ADDED, _ITEM_ADDED, $message,$extrahead); |
119 | 104 | } |
120 | 105 | |
121 | 106 | function bm_doEditItem() { |
122 | 107 | global $member, $manager, $CONF; |
123 | - | |
124 | - $itemid = intRequestVar('itemid'); | |
125 | - $catid = postVar('catid'); | |
126 | - | |
108 | + | |
109 | + $itemid = intRequestVar('itemid'); | |
110 | + $catid = postVar('catid'); | |
111 | + | |
127 | 112 | // only allow if user is allowed to alter item |
128 | - if (!$member->canUpdateItem($itemid, $catid) ) { | |
113 | + if (!$member->canUpdateItem($itemid, $catid)) | |
129 | 114 | bm_doError(_ERROR_DISALLOWED); |
130 | - } | |
131 | 115 | |
132 | - $body = postVar('body'); | |
133 | - $title = postVar('title'); | |
134 | - $more = postVar('more'); | |
135 | - $closed = intPostVar('closed'); | |
116 | + $body = postVar('body'); | |
117 | + $title = postVar('title'); | |
118 | + $more = postVar('more'); | |
119 | + $closed = intPostVar('closed'); | |
136 | 120 | $actiontype = postVar('actiontype'); |
137 | - $draftid = intPostVar('draftid'); | |
138 | - | |
121 | + | |
139 | 122 | // redirect to admin area on delete (has delete confirmation) |
140 | 123 | if ($actiontype == 'delete') { |
141 | - redirect('index.php?action=itemdelete&itemid=' . $itemid); | |
142 | - exit; | |
124 | + redirect('index.php?action=itemdelete&itemid='.$itemid); | |
125 | + exit; | |
143 | 126 | } |
144 | - | |
127 | + | |
145 | 128 | // create new category if needed (only on edit/changedate) |
146 | - if (strstr($catid,'newcat') ) { | |
147 | - // get blogid | |
148 | - list($blogid) = sscanf($catid, "newcat-%d"); | |
129 | + if (strstr($catid,'newcat')) { | |
130 | + // get blogid | |
131 | + list($blogid) = sscanf($catid,"newcat-%d"); | |
149 | 132 | |
150 | 133 | // create |
151 | 134 | $blog =& $manager->getBlog($blogid); |
152 | 135 | $catid = $blog->createNewCategory(); |
153 | 136 | |
154 | 137 | // show error when sth goes wrong |
155 | - if (!$catid) { | |
138 | + if (!$catid) | |
156 | 139 | bm_doError('Could not create new category'); |
157 | - } | |
158 | - } | |
140 | + } | |
159 | 141 | |
160 | 142 | // only edit action is allowed for bookmarklet edit |
161 | 143 | switch ($actiontype) { |
162 | 144 | case 'changedate': |
163 | 145 | $publish = 1; |
164 | 146 | $wasdraft = 0; |
165 | - $timestamp = mktime(postVar('hour'), postVar('minutes'), 0, postVar('month'), postVar('day'), postVar('year') ); | |
147 | + $timestamp = mktime(postVar('hour'), postVar('minutes'), 0, postVar('month'), postVar('day'), postVar('year')); | |
166 | 148 | break; |
167 | 149 | case 'edit': |
168 | 150 | $publish = 1; |
@@ -172,20 +154,15 @@ function bm_doEditItem() { | ||
172 | 154 | default: |
173 | 155 | bm_doError('Something went wrong'); |
174 | 156 | } |
175 | - | |
157 | + | |
176 | 158 | // update item for real |
177 | 159 | ITEM::update($itemid, $catid, $title, $body, $more, $closed, $wasdraft, $publish, $timestamp); |
178 | - | |
179 | - if ($draftid > 0) { | |
180 | - ITEM::delete($draftid); | |
181 | - } | |
182 | - | |
160 | + | |
183 | 161 | // show success message |
184 | - if ($catid != intPostVar('catid') ) { | |
162 | + if ($catid != intPostVar('catid')) | |
185 | 163 | bm_message(_ITEM_UPDATED, _ITEM_UPDATED, 'アイテムは追加され、新しいカテゴリーが作成されました。<a href="index.php?action=categoryedit&blogid='.$blog->getID().'&catid='.$catid.'" onclick="if (event && event.preventDefault) event.preventDefault(); window.open(this.href); return false;" title="Opens in new window">ここをクリックしてカテゴリーの名前と説明を編集してください。</a>', ''); |
186 | - } else { | |
164 | + else | |
187 | 165 | bm_message(_ITEM_UPDATED, _ITEM_UPDATED, _ITEM_UPDATED, ''); |
188 | - } | |
189 | 166 | } |
190 | 167 | |
191 | 168 | function bm_loginAndPassThrough() { |
@@ -194,7 +171,7 @@ function bm_loginAndPassThrough() { | ||
194 | 171 | $log_text = requestVar('logtext'); |
195 | 172 | $log_link = requestVar('loglink'); |
196 | 173 | $log_linktitle = requestVar('loglinktitle'); |
197 | - | |
174 | + | |
198 | 175 | ?> |
199 | 176 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
200 | 177 | <html xmlns="http://www.w3.org/1999/xhtml"> |
@@ -204,24 +181,24 @@ function bm_loginAndPassThrough() { | ||
204 | 181 | <?php bm_style(); ?> |
205 | 182 | </head> |
206 | 183 | <body> |
207 | - <h1><?php echo _LOGIN_PLEASE ?></h1> | |
208 | - | |
184 | + <h1><?php echo _LOGIN_PLEASE?></h1> | |
185 | + | |
209 | 186 | <form method="post" action="bookmarklet.php"> |
210 | 187 | <p> |
211 | 188 | <input name="action" value="login" type="hidden" /> |
212 | - <input name="blogid" value="<?php echo htmlspecialchars($blogid); ?>" type="hidden" /> | |
213 | - <input name="logtext" value="<?php echo htmlspecialchars($log_text); ?>" type="hidden" /> | |
214 | - <input name="loglink" value="<?php echo htmlspecialchars($log_link); ?>" type="hidden" /> | |
215 | - <input name="loglinktitle" value="<?php echo htmlspecialchars($log_linktitle); ?>" type="hidden" /> | |
216 | - <?php echo _LOGINFORM_NAME ?>: | |
189 | + <input name="blogid" value="<?php echo htmlspecialchars($blogid) ?>" type="hidden" /> | |
190 | + <input name="logtext" value="<?php echo htmlspecialchars($log_text) ?>" type="hidden" /> | |
191 | + <input name="loglink" value="<?php echo htmlspecialchars($log_link) ?>" type="hidden" /> | |
192 | + <input name="loglinktitle" value="<?php echo htmlspecialchars($log_linktitle) ?>" type="hidden" /> | |
193 | + <?php echo _LOGINFORM_NAME?>: | |
217 | 194 | <br /><input name="login" /> |
218 | - <br /><?php echo _LOGINFORM_PWD ?>: | |
195 | + <br /><?php echo _LOGINFORM_PWD?>: | |
219 | 196 | <br /><input name="password" type="password" /> |
220 | 197 | <br /><br /> |
221 | - <br /><input type="submit" value="<?php echo _LOGIN ?>" /> | |
198 | + <br /><input type="submit" value="<?php echo _LOGIN?>" /> | |
222 | 199 | </p> |
223 | 200 | </form> |
224 | - <p><a href="bookmarklet.php" onclick="window.close();"><?php echo _POPUP_CLOSE ?></a></p> | |
201 | + <p><a href="bookmarklet.php" onclick="window.close();"><?php echo _POPUP_CLOSE?></a></p> | |
225 | 202 | </body> |
226 | 203 | </html> |
227 | 204 | <?php |
@@ -229,7 +206,7 @@ function bm_loginAndPassThrough() { | ||
229 | 206 | |
230 | 207 | function bm_doShowForm() { |
231 | 208 | global $member; |
232 | - | |
209 | + | |
233 | 210 | $blogid = intRequestVar('blogid'); |
234 | 211 | $log_text = trim(requestVar('logtext')); |
235 | 212 | $log_link = requestVar('loglink'); |
@@ -241,60 +218,53 @@ function bm_doShowForm() { | ||
241 | 218 | if (!BLOG::existsID($blogid)) |
242 | 219 | bm_doError(_ERROR_NOSUCHBLOG); |
243 | 220 | |
244 | - if (!$member->isTeamMember($blogid) ) { | |
221 | + if (!$member->isTeamMember($blogid)) | |
245 | 222 | bm_doError(_ERROR_NOTONTEAM); |
246 | - } | |
247 | - | |
223 | + | |
248 | 224 | $logje = ''; |
249 | - | |
250 | - if ($log_text) { | |
251 | - $logje .= '<blockquote><div>"' . htmlspecialchars($log_text) . '"</div></blockquote>' . "\n"; | |
252 | - } | |
253 | - | |
254 | - if (!$log_linktitle) { | |
225 | + if ($log_text) | |
226 | + $logje .= '<blockquote><div>"' . htmlspecialchars($log_text) .'"</div></blockquote>' . "\n"; | |
227 | + if (!$log_linktitle) | |
255 | 228 | $log_linktitle = $log_link; |
256 | - } | |
257 | - | |
258 | - if ($log_link) { | |
259 | - $logje .= '<a href="' . htmlspecialchars($log_link) . '">' . htmlspecialchars($log_linktitle) . '</a>'; | |
260 | - } | |
229 | + if ($log_link) | |
230 | + $logje .= '<a href="'. htmlspecialchars($log_link) . '">'. htmlspecialchars($log_linktitle).'</a>'; | |
231 | + | |
261 | 232 | |
262 | 233 | $item['body'] = $logje; |
263 | 234 | $item['title'] = htmlspecialchars($log_linktitle); |
264 | 235 | |
265 | 236 | $factory = new PAGEFACTORY($blogid); |
266 | - $factory->createAddForm('bookmarklet', $item); | |
237 | + $factory->createAddForm('bookmarklet',$item); | |
267 | 238 | } |
268 | 239 | |
269 | 240 | function bm_doEditForm() { |
270 | 241 | global $member, $manager; |
271 | - | |
242 | + | |
272 | 243 | $itemid = intRequestVar('itemid'); |
273 | - | |
274 | - if (!$manager->existsItem($itemid, 0, 0) ) { | |
244 | + | |
245 | + if (!$manager->existsItem($itemid, 0, 0)) | |
275 | 246 | bm_doError(_ERROR_NOSUCHITEM); |
276 | - } | |
277 | - | |
278 | - if (!$member->canAlterItem($itemid) ) { | |
247 | + | |
248 | + if (!$member->canAlterItem($itemid)) | |
279 | 249 | bm_doError(_ERROR_DISALLOWED); |
280 | - } | |
281 | - | |
282 | - $item =& $manager->getItem($itemid, 1, 1); | |
283 | - $blog =& $manager->getBlog(getBlogIDFromItemID($itemid) ); | |
284 | - | |
285 | - $manager->notify('PrepareItemForEdit', array('item' => &$item) ); | |
250 | + | |
251 | + $item =& $manager->getItem($itemid,1,1); | |
252 | + $blog =& $manager->getBlog(getBlogIDFromItemID($itemid)); | |
253 | + | |
254 | + $manager->notify('PrepareItemForEdit', array('item' => &$item)); | |
286 | 255 | |
287 | - if ($blog->convertBreaks() ) { | |
256 | + if ($blog->convertBreaks()) { | |
288 | 257 | $item['body'] = removeBreaks($item['body']); |
289 | 258 | $item['more'] = removeBreaks($item['more']); |
290 | 259 | } |
291 | 260 | |
292 | - $formfactory = new PAGEFACTORY($blog->getID() ); | |
293 | - $formfactory->createEditForm('bookmarklet', $item); | |
261 | + $formfactory = new PAGEFACTORY($blog->getID()); | |
262 | + $formfactory->createEditForm('bookmarklet',$item); | |
263 | + | |
294 | 264 | } |
295 | 265 | |
296 | 266 | function bm_doError($msg) { |
297 | - bm_message(_ERROR, _ERRORMSG, $msg); | |
267 | + bm_message(_ERROR,_ERRORMSG,$msg); | |
298 | 268 | die; |
299 | 269 | } |
300 | 270 |
@@ -306,34 +276,33 @@ function bm_message($title, $head, $msg, $extrahead = '') { | ||
306 | 276 | <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" /> |
307 | 277 | <title><?php echo $title ?></title> |
308 | 278 | <?php bm_style(); ?> |
309 | - <?php echo $extrahead; ?> | |
279 | + <?php echo $extrahead?> | |
310 | 280 | </head> |
311 | 281 | <body> |
312 | - <h1><?php echo $head; ?></h1> | |
313 | - <p><?php echo $msg; ?></p> | |
314 | - <p><a href="bookmarklet.php" onclick="window.close();"><?php echo _POPUP_CLOSE ?></a></p> | |
282 | + <h1><?php echo $head ?></h1> | |
283 | + <p><?php echo $msg ?></p> | |
284 | + <p><a href="bookmarklet.php" onclick="window.close();"><?php echo _POPUP_CLOSE?></a></p> | |
315 | 285 | </body> |
316 | 286 | </html> |
317 | - | |
318 | - <?php | |
319 | -} | |
287 | + | |
288 | + <?php } | |
320 | 289 | |
321 | 290 | function bm_style() { |
322 | 291 | echo '<link rel="stylesheet" type="text/css" href="styles/bookmarklet.css" />'; |
323 | - echo '<link rel="stylesheet" type="text/css" href="styles/addedit.css" />'; | |
292 | + echo '<link rel="stylesheet" type="text/css" href="styles/addedit.css" />'; | |
324 | 293 | } |
325 | 294 | |
326 | 295 | function bm_doContextMenuCode() { |
327 | 296 | global $CONF; |
328 | 297 | ?> |
329 | 298 | <script type="text/javascript" defer="defer"> |
330 | -doc = external.menuArguments.document; | |
331 | -lt = escape(doc.selection.createRange().text); | |
332 | -loglink = escape(external.menuArguments.location.href); | |
333 | -loglinktitle = escape(doc.title); | |
334 | -wingm = window.open('<?php echo $CONF['AdminURL']?>bookmarklet.php?blogid=<?php echo intGetVar('blogid')?>&logtext=' + lt + '&loglink=' + loglink + '&loglinktitle=' + loglinktitle, 'nucleusbm', 'scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes'); | |
299 | +doc=external.menuArguments.document; | |
300 | +lt=escape(doc.selection.createRange().text); | |
301 | +loglink=escape(external.menuArguments.location.href); | |
302 | +loglinktitle=escape(doc.title); | |
303 | +wingm=window.open('<?php echo $CONF['AdminURL']?>bookmarklet.php?blogid=<?php echo intGetVar('blogid')?>&logtext='+lt+'&loglink='+loglink+'&loglinktitle='+loglinktitle,'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes'); | |
335 | 304 | wingm.focus(); |
336 | -</script> | |
305 | +</script> | |
337 | 306 | <?php |
338 | 307 | } |
339 | 308 |
@@ -1,9 +1,9 @@ | ||
1 | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
2 | 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
3 | 3 | <head> |
4 | - <!-- $Id: forgotpassword.html,v 1.6.2.1 2007-03-27 11:26:59 kimitake Exp $ --> | |
5 | - <!-- $NucleusJP: forgotpassword.html,v 1.10 2007/02/21 15:19:32 kimitake Exp $ --> | |
6 | - <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" /> | |
4 | + <!-- $Id: forgotpassword.html,v 1.6.2.2 2007-03-27 11:46:58 kimitake Exp $ --> | |
5 | + <!-- $NucleusJP: forgotpassword.html,v 1.6 2005/03/16 08:04:14 kimitake Exp $ --> | |
6 | + <meta http-equiv="content-type" content="application/xhtml+xml; charset=EUC-JP" /> | |
7 | 7 | <title>Nucleus - パスワードの紛失</title> |
8 | 8 | <style type="text/css"> |
9 | 9 | <!-- |
@@ -43,7 +43,7 @@ | ||
43 | 43 | |
44 | 44 | |
45 | 45 | <div class="foot"> |
46 | - <a href="http://nucleuscms.org/">Nucleus © 2001-2007 The Nucleus Group</a> | |
46 | + <a href="http://nucleuscms.org/">Nucleus © 2001-2005 The Nucleus Group</a> | |
47 | 47 | </div> |
48 | 48 | |
49 | 49 | </div><!-- content --> |
@@ -1,18 +1,19 @@ | ||
1 | 1 | <a id="nucleus_cf"></a> |
2 | 2 | <form method="post" action="#nucleus_cf"> |
3 | - <div class="commentform"> | |
4 | -<input type="hidden" name="action" value="addcomment" /> | |
5 | -<input type="hidden" name="url" value="<%formdata(destinationurl)%>" /> | |
6 | -<input type="hidden" name="itemid" value="<%itemid%>" /> | |
7 | - <%errordiv%> | |
8 | - <label for="nucleus_cf_body"><%text(_COMMENTFORM_COMMENT)%></label> | |
9 | - <textarea name="body" class="formfield" cols="40" rows="10" id="nucleus_cf_body"><%formdata(body)%></textarea> | |
10 | - | |
11 | - <%text(_COMMENTFORM_YOUARE)%> <%formdata(membername)%> | |
12 | - <small>(<a href="<%self%>?action=logout" title="<%text(_LOGOUT)%>"><%text(_LOGOUT)%></a>)</small> | |
13 | - | |
14 | - <input type="submit" alt="<%text(_COMMENTFORM_SUBMIT)%>" value="<%text(_COMMENTFORM_SUBMIT)%>" class="formbutton" /> | |
15 | - | |
16 | - <%callback(FormExtra,commentform-loggedin)%> | |
17 | - </div> | |
18 | -</form> | |
3 | + <div class="commentform"> | |
4 | + <%errordiv%> | |
5 | + | |
6 | + <input type="hidden" name="action" value="addcomment" /> | |
7 | + <input type="hidden" name="url" value="<%formdata(destinationurl)%>" /> | |
8 | + <input type="hidden" name="itemid" value="<%itemid%>" /> | |
9 | + <label for="nucleus_cf_body"><%text(_COMMENTFORM_COMMENT)%></label>: | |
10 | + <br /> | |
11 | + <textarea name="body" class="formfield" cols="40" rows="10" id="nucleus_cf_body"><%formdata(body)%></textarea> | |
12 | + <br /> | |
13 | + <%text(_COMMENTFORM_YOUARE)%> <%formdata(membername)%> | |
14 | + <small>(<a href="?action=logout"><%text(_LOGOUT)%></a>)</small> | |
15 | + <br /> | |
16 | + <input type="submit" value="<%text(_COMMENTFORM_SUBMIT)%>" class="formbutton" /> | |
17 | + <%callback(FormExtra,commentform-loggedin)%> | |
18 | + </div> | |
19 | +</form> | |
\ No newline at end of file |
@@ -1,28 +1,25 @@ | ||
1 | 1 | <a id="nucleus_cf"></a> |
2 | -<form method="post" action="#nucleus_cf"> | |
3 | - <div class="commentform"> | |
4 | -<input type="hidden" name="action" value="addcomment" /> | |
5 | -<input type="hidden" name="url" value="<%formdata(destinationurl)%>" /> | |
6 | -<input type="hidden" name="itemid" value="<%itemid%>" /> | |
7 | - <%errordiv%> | |
2 | +<form method="post" action="#nucleus_cf"> | |
3 | + <div class="commentform"> | |
8 | 4 | |
9 | - <label for="nucleus_cf_body"><%text(_COMMENTFORM_COMMENT)%></label> | |
10 | - <textarea name="body" class="formfield" cols="40" rows="10" id="nucleus_cf_body"><%formdata(body)%></textarea> | |
5 | + <%errordiv%> | |
11 | 6 | |
12 | - <label for="nucleus_cf_name"><%text(_COMMENTFORM_NAME)%></label> | |
13 | - <input name="user" size="40" maxlength="40" value="<%formdata(user)%>" class="formfield" id="nucleus_cf_name" /> | |
7 | + <input type="hidden" name="action" value="addcomment" /> | |
8 | + <input type="hidden" name="url" value="<%formdata(destinationurl)%>" /> | |
9 | + <input type="hidden" name="itemid" value="<%itemid%>" /> | |
10 | + <label for="nucleus_cf_body"><%text(_COMMENTFORM_COMMENT)%></label>: | |
11 | + <br /> | |
12 | + <textarea name="body" class="formfield" cols="40" rows="10" id="nucleus_cf_body"><%formdata(body)%></textarea> | |
13 | + <br /> | |
14 | + <label for="nucleus_cf_name"><%text(_COMMENTFORM_NAME)%></label>: <input name="user" size="40" maxlength="40" value="<%formdata(user)%>" class="formfield" id="nucleus_cf_name" /> | |
15 | + <br /> | |
16 | + <label for="nucleus_cf_mail"><%text(_COMMENTFORM_MAIL)%></label>: <input name="userid" size="40" maxlength="60" value="<%formdata(userid)%>" class="formfield" id="nucleus_cf_mail" /> | |
14 | 17 | |
15 | - <label for="nucleus_cf_mail"><%text(_COMMENTFORM_MAIL)%></label> | |
16 | - <input name="userid" size="40" maxlength="60" value="<%formdata(userid)%>" class="formfield" id="nucleus_cf_mail" /> | |
17 | - | |
18 | - <label for="nucleus_cf_email"><%text(_COMMENTFORM_EMAIL)%></label> | |
19 | - <input name="email" size="40" maxlength="100" value="<%formdata(email)%>" class="formfield" id="nucleus_cf_email" /> | |
20 | - | |
21 | - <%callback(FormExtra,commentform-notloggedin)%> | |
22 | - | |
23 | - <input type="checkbox" value="1" name="remember" id="nucleus_cf_remember" <%formdata(rememberchecked)%> /> | |
24 | - <label for="nucleus_cf_remember"><%text(_COMMENTFORM_REMEMBER)%></label> | |
25 | - | |
26 | - <input type="submit" alt="<%text(_COMMENTFORM_SUBMIT)%>" value="<%text(_COMMENTFORM_SUBMIT)%>" class="formbutton" /> | |
27 | - </div> | |
28 | -</form> | |
18 | + <%callback(FormExtra,commentform-notloggedin)%> | |
19 | + | |
20 | + <br /> | |
21 | + <input type="checkbox" value="1" name="remember" id="nucleus_cf_remember" <%formdata(rememberchecked)%> /><label for="nucleus_cf_remember"><%text(_COMMENTFORM_REMEMBER)%></label> | |
22 | + <br /> | |
23 | + <input type="submit" value="<%text(_COMMENTFORM_SUBMIT)%>" class="formbutton" /> | |
24 | + </div> | |
25 | +</form> | |
\ No newline at end of file |
@@ -1,4 +1,4 @@ | ||
1 | 1 | <a id="nucleus_lf"></a> |
2 | 2 | <div class="loginform"> |
3 | - <%text(_LOGINFORM_YOUARE)%> <%formdata(membername)%> ! (<a href="<%self%>?action=logout" title="<%text(_LOGOUT)%>"><%text(_LOGOUT)%></a>) | |
3 | + <%text(_LOGINFORM_YOUARE)%> <%formdata(membername)%> ! (<a href="<%self%>?action=logout"><%text(_LOGOUT)%></a>) | |
4 | 4 | </div> |
@@ -1,18 +1,16 @@ | ||
1 | 1 | <a id="nucleus_lf"></a> |
2 | 2 | <form method="post" action="#nucleus_lf"> |
3 | - <div class="loginform"> | |
4 | -<input type="hidden" name="action" value="login" /> | |
5 | - <%errordiv%> | |
6 | - | |
7 | - <label for="nucleus_lf_name" accesskey="l"><%text(_LOGINFORM_NAME)%></label> | |
8 | - <input id="nucleus_lf_name" name="login" size="10" value="" class="formfield" /> | |
9 | - | |
10 | - <label for="nucleus_lf_pwd"><%text(_LOGINFORM_PWD)%></label> | |
11 | - <input id="nucleus_lf_pwd" name="password" size="10" type="password" value="" class="formfield" /> | |
12 | - | |
13 | - <input type="checkbox" value="1" name="shared" id="nucleus_lf_shared" /> | |
14 | - <label for="nucleus_lf_shared"><%text(_LOGINFORM_SHARED)%></label> | |
15 | - | |
16 | - <input type="submit" alt="<%text(_LOGIN)%>" value="<%text(_LOGIN)%>" class="formbutton" /> | |
17 | - </div> | |
18 | -</form> | |
3 | + <div class="loginform"> | |
4 | + | |
5 | + <%errordiv%> | |
6 | + | |
7 | + <input type="hidden" name="action" value="login" /> | |
8 | + <label for="nucleus_lf_name" accesskey="l"><%text(_LOGINFORM_NAME)%></label>: <input id="nucleus_lf_name" name="login" size="10" value="" class="formfield" /> | |
9 | + <br /> | |
10 | + <label for="nucleus_lf_pwd"><%text(_LOGINFORM_PWD)%></label>: <input id="nucleus_lf_pwd" name="password" size="10" type="password" value="" class="formfield" /> | |
11 | + <br /> | |
12 | + <input type="submit" value="<%text(_LOGIN)%>" class="formbutton" /> | |
13 | + <br /> | |
14 | + <input type="checkbox" value="1" name="shared" id="nucleus_lf_shared" /><label for="nucleus_lf_shared"><%text(_LOGINFORM_SHARED)%></label> | |
15 | + </div> | |
16 | +</form> | |
\ No newline at end of file |
@@ -1,15 +1,19 @@ | ||
1 | 1 | <a id="nucleus_mf"></a> |
2 | 2 | <form method="post" action="#nucleus_mf"> |
3 | - <div class="mailform"> | |
4 | -<input type="hidden" name="memberid" value="<%formdata(memberid)%>" /> | |
5 | -<input type="hidden" name="action" value="sendmessage" /> | |
6 | -<input type="hidden" name="url" value="<%formdata(url)%>" /> | |
7 | - <%errordiv%> | |
3 | + <div class="mailform"> | |
4 | + <%errordiv%> | |
5 | + | |
6 | + <input type="hidden" name="memberid" value="<%formdata(memberid)%>" /> | |
7 | + <input type="hidden" name="action" value="sendmessage" /> | |
8 | 8 | |
9 | - <textarea alt="<%text(_MMAIL_MAIL)%>" name="message" class="formfield" rows="<%formdata(rows)%>" cols="<%formdata(cols)%>"><%formdata(message)%></textarea> | |
9 | + <input type="hidden" name="url" value="<%formdata(url)%>" /> | |
10 | 10 | |
11 | - <%callback(FormExtra,membermailform-loggedin)%> | |
11 | + <textarea name="message" class="formfield" rows="<%formdata(rows)%>" cols="<%formdata(cols)%>"><%formdata(message)%></textarea> | |
12 | 12 | |
13 | - <input type="submit" alt="<%text(_MEMBERMAIL_SUBMIT)%>" value="<%text(_MEMBERMAIL_SUBMIT)%>" class="formbutton" /> | |
14 | - </div> | |
15 | -</form> | |
13 | + <%callback(FormExtra,membermailform-loggedin)%> | |
14 | + | |
15 | + <br /> | |
16 | + <input type="submit" value="<%text(_MEMBERMAIL_SUBMIT)%>" class="formbutton" /> | |
17 | + | |
18 | + </div> | |
19 | +</form> |
@@ -1,18 +1,20 @@ | ||
1 | 1 | <a id="nucleus_mf"></a> |
2 | 2 | <form method="post" action="#nucleus_mf"> |
3 | - <div class="mailform"> | |
4 | -<input type="hidden" name="memberid" value="<%formdata(memberid)%>" /> | |
5 | -<input type="hidden" name="action" value="sendmessage" /> | |
6 | -<input type="hidden" name="url" value="<%formdata(url)%>" /> | |
7 | - <%errordiv%> | |
3 | + <div class="mailform"> | |
4 | + <%errordiv%> | |
5 | + | |
6 | + <input type="hidden" name="memberid" value="<%formdata(memberid)%>" /> | |
7 | + <input type="hidden" name="action" value="sendmessage" /> | |
8 | 8 | |
9 | - <textarea alt="<%text(_MMAIL_MAIL)%>" name="message" class="formfield" rows="<%formdata(rows)%>" cols="<%formdata(cols)%>"><%formdata(message)%></textarea> | |
9 | + <input type="hidden" name="url" value="<%formdata(url)%>" /> | |
10 | 10 | |
11 | - <label for="nucleus_mmf_frommail"><%text(_MEMBERMAIL_MAIL)%></label> | |
12 | - <input id="nucleus_mmf_frommail" type="text" name="frommail" class="formfield" value="<%formdata(frommail)%>" /> | |
13 | - | |
14 | - <%callback(FormExtra,membermailform-notloggedin)%> | |
15 | - | |
16 | - <input type="submit" alt="<%text(_MEMBERMAIL_SUBMIT)%>" value="<%text(_MEMBERMAIL_SUBMIT)%>" class="formbutton" /> | |
17 | - </div> | |
18 | -</form> | |
11 | + <textarea name="message" class="formfield" rows="<%formdata(rows)%>" cols="<%formdata(cols)%>"><%formdata(message)%></textarea> | |
12 | + <br /> | |
13 | + <%text(_MEMBERMAIL_MAIL)%><input type="text" name="frommail" class="formfield" value="<%formdata(frommail)%>" /> | |
14 | + | |
15 | + <%callback(FormExtra,membermailform-notloggedin)%> | |
16 | + | |
17 | + <br /> | |
18 | + <input type="submit" value="<%text(_MEMBERMAIL_SUBMIT)%>" class="formbutton" /> | |
19 | + </div> | |
20 | +</form> |
@@ -1,3 +1,3 @@ | ||
1 | 1 | <div class="nucleusbutton"> |
2 | - <a href="http://nucleuscms.org/"><img src="<%formdata(imgurl)%>" width="<%formdata(imgwidth)%>" height="<%formdata(imgheight)%>" alt="Powered by Nucleus CMS" title="Powered by Nucleus CMS" /></a> | |
2 | +<a href="http://nucleuscms.org/"><img src="<%formdata(imgurl)%>" width="<%formdata(imgwidth)%>" height="<%formdata(imgheight)%>" alt="Powered by Nucleus CMS" /></a> | |
3 | 3 | </div> |
@@ -1,8 +1,9 @@ | ||
1 | 1 | <form method="get" action="<%self%>"> |
2 | - <div class="searchform"> | |
3 | -<input type="hidden" name="amount" value="0" /> | |
4 | -<input type="hidden" name="blogid" value="<%formdata(id)%>" /> | |
5 | - <input name="query" alt="<%text(_SEARCHFORM_QUERY)%>" class="formfield" size="10" maxlength="60" accesskey="4" value="<%formdata(query)%>" /> | |
6 | - <input type="submit" alt="<%text(_SEARCHFORM_SUBMIT)%>" value="<%text(_SEARCHFORM_SUBMIT)%>" class="formbutton" /> | |
7 | - </div> | |
2 | + <div class="searchform"> | |
3 | + <input name="query" class="formfield" size="10" maxlength="60" accesskey="4" value="<%formdata(query)%>" /> | |
4 | + <input type="hidden" name="amount" value="0" /> | |
5 | + <input type="hidden" name="blogid" value="<%formdata(id)%>" /> | |
6 | + <br /> | |
7 | + <input type="submit" value="<%text(_SEARCHFORM_SUBMIT)%>" class="formbutton" /> | |
8 | + </div> | |
8 | 9 | </form> |
@@ -1,20 +1,20 @@ | ||
1 | 1 | <?php |
2 | 2 | /* |
3 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | - * Copyright (C) 2002-2007 The Nucleus Group | |
5 | - * | |
6 | - * This program is free software; you can redistribute it and/or | |
7 | - * modify it under the terms of the GNU General Public License | |
8 | - * as published by the Free Software Foundation; either version 2 | |
9 | - * of the License, or (at your option) any later version. | |
10 | - * (see nucleus/documentation/index.html#license for more info) | |
3 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | + * Copyright (C) 2002-2005 The Nucleus Group | |
5 | + * | |
6 | + * This program is free software; you can redistribute it and/or | |
7 | + * modify it under the terms of the GNU General Public License | |
8 | + * as published by the Free Software Foundation; either version 2 | |
9 | + * of the License, or (at your option) any later version. | |
10 | + * (see nucleus/documentation/index.html#license for more info) | |
11 | 11 | */ |
12 | 12 | /** |
13 | 13 | * @license http://nucleuscms.org/license.txt GNU General Public License |
14 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
15 | - * @version $Id: index.php,v 1.3.2.2 2007-03-27 11:26:59 kimitake Exp $ | |
16 | - * $NucleusJP: index.php,v 1.8 2007/02/04 06:28:45 kimitake Exp $ | |
17 | - */ | |
14 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
15 | + * @version $Id: index.php,v 1.3.2.3 2007-03-27 11:46:58 kimitake Exp $ | |
16 | + * @version $NucleusJP: index.php,v 1.3.2.1 2005/08/23 08:08:37 kimitake Exp $ | |
17 | + */ | |
18 | 18 | // we are using admin stuff: |
19 | 19 | $CONF = array(); |
20 | 20 | $CONF['UsingAdminArea'] = 1; |
@@ -51,10 +51,10 @@ | ||
51 | 51 | |
52 | 52 | $bNeedsLogin = false; |
53 | 53 | $bIsActivation = in_array($action, array('activate', 'activatesetpwd')); |
54 | - | |
55 | - if ($action == 'logout') | |
56 | - $bNeedsLogin = true; | |
57 | - | |
54 | + | |
55 | + if ($action == 'logout') | |
56 | + $bNeedsLogin = true; | |
57 | + | |
58 | 58 | if (!$member->isLoggedIn() && !$bIsActivation) |
59 | 59 | $bNeedsLogin = true; |
60 | 60 |
@@ -63,7 +63,7 @@ | ||
63 | 63 | $error = _ERROR_LOGINDISALLOWED; |
64 | 64 | $bNeedsLogin = true; |
65 | 65 | } |
66 | - | |
66 | + | |
67 | 67 | if ($bNeedsLogin) |
68 | 68 | { |
69 | 69 | setOldAction($action); // see ADMIN::login() (sets old action in POST vars) |
@@ -71,7 +71,7 @@ | ||
71 | 71 | } |
72 | 72 | |
73 | 73 | sendContentType('application/xhtml+xml', 'admin-' . $action); |
74 | - | |
74 | + | |
75 | 75 | $admin = new ADMIN(); |
76 | 76 | $admin->action($action); |
77 | -?> | |
\ No newline at end of file | ||
77 | +?> |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | 2 | * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) |
3 | - * Copyright (C) 2002-2007 The Nucleus Group | |
3 | + * Copyright (C) 2002-2005 The Nucleus Group | |
4 | 4 | * |
5 | 5 | * This program is free software; you can redistribute it and/or |
6 | 6 | * modify it under the terms of the GNU General Public License |
@@ -10,8 +10,8 @@ | ||
10 | 10 | * |
11 | 11 | * Some JavaScript code for the admin area |
12 | 12 | * |
13 | - * $Id: admin.js,v 1.3.2.1 2007-03-27 11:27:16 kimitake Exp $ | |
14 | - * $NucleusJP: admin.js,v 1.6 2007/02/28 07:22:22 kimitake Exp $ | |
13 | + * $Id: admin.js,v 1.3.2.2 2007-03-27 11:47:14 kimitake Exp $ | |
14 | + * $NucleusJP: admin.js,v 1.3 2005/03/16 08:07:24 kimitake Exp $ | |
15 | 15 | */ |
16 | 16 | |
17 | 17 | function help(url) { |
@@ -46,15 +46,4 @@ function batchSelectAll(what) { | ||
46 | 46 | } |
47 | 47 | return false; |
48 | 48 | } |
49 | -function selectCanLogin(flag) { | |
50 | - if (flag) { | |
51 | - window.document.memberedit.canlogin[0].checked=true; | |
52 | 49 | |
53 | - // don't disable canlogin[0], otherwise the value won't be passed. | |
54 | -// window.document.memberedit.canlogin[0].disabled=true; | |
55 | - window.document.memberedit.canlogin[1].disabled=true; | |
56 | - } else { | |
57 | - window.document.memberedit.canlogin[0].disabled=false; | |
58 | - window.document.memberedit.canlogin[1].disabled=false; | |
59 | - } | |
60 | -} |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | 2 | * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) |
3 | - * Copyright (C) 2002-2007 The Nucleus Group | |
3 | + * Copyright (C) 2002-2005 The Nucleus Group | |
4 | 4 | * |
5 | 5 | * This program is free software; you can redistribute it and/or |
6 | 6 | * modify it under the terms of the GNU General Public License |
@@ -10,8 +10,8 @@ | ||
10 | 10 | * |
11 | 11 | * Some JavaScript code for the bookmarklets |
12 | 12 | * |
13 | - * $Id: bookmarklet.js,v 1.3.2.1 2007-03-27 11:27:16 kimitake Exp $ | |
14 | - * $NucleusJP: bookmarklet.js,v 1.5 2007/02/04 06:28:45 kimitake Exp $ | |
13 | + * $Id: bookmarklet.js,v 1.3.2.2 2007-03-27 11:47:14 kimitake Exp $ | |
14 | + * $NucleusJP: bookmarklet.js,v 1.3 2005/03/16 08:07:50 kimitake Exp $ | |
15 | 15 | */ |
16 | 16 | |
17 | 17 | /** |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | 2 | * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) |
3 | - * Copyright (C) 2002-2007 The Nucleus Group | |
3 | + * Copyright (C) 2002-2005 The Nucleus Group | |
4 | 4 | * |
5 | 5 | * This program is free software; you can redistribute it and/or |
6 | 6 | * modify it under the terms of the GNU General Public License |
@@ -18,8 +18,8 @@ | ||
18 | 18 | * |
19 | 19 | * That's basically it :) |
20 | 20 | * |
21 | - * $Id: compatibility.js,v 1.3.2.1 2007-03-27 11:27:16 kimitake Exp $ | |
22 | - * $NucleusJP: compatibility.js,v 1.5 2007/02/04 06:28:45 kimitake Exp $ | |
21 | + * $Id: compatibility.js,v 1.3.2.2 2007-03-27 11:47:14 kimitake Exp $ | |
22 | + * $NucleusJP: compatibility.js,v 1.3 2005/03/16 08:07:50 kimitake Exp $ | |
23 | 23 | */ |
24 | 24 | |
25 | 25 | // to get the script working when page is sent as application/xhtml+xml |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
3 | - * Copyright (C) 2002-2007 The Nucleus Group | |
2 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
3 | + * Copyright (C) 2002-2005 The Nucleus Group | |
4 | 4 | * |
5 | 5 | * This program is free software; you can redistribute it and/or |
6 | 6 | * modify it under the terms of the GNU General Public License |
@@ -11,8 +11,8 @@ | ||
11 | 11 | * This file contains functions to allow adding items from inside the weblog. |
12 | 12 | * Also contains code to avoid submitting form data twice. |
13 | 13 | * |
14 | - * $Id: edit.js,v 1.4.2.2 2007-03-27 11:27:16 kimitake Exp $ | |
15 | - * $NucleusJP: edit.js,v 1.6 2007/02/04 06:28:45 kimitake Exp $ | |
14 | + * $Id: edit.js,v 1.4.2.3 2007-03-27 11:47:14 kimitake Exp $ | |
15 | + * $NucleusJP: edit.js,v 1.4.2.1 2005/09/27 06:58:41 kimitake Exp $ | |
16 | 16 | */ |
17 | 17 | |
18 | 18 | var nucleusConvertBreaks = true; |
@@ -28,17 +28,17 @@ function setAuthorId(id) { nucleusAuthorId = id; } | ||
28 | 28 | function preview(id, value) { |
29 | 29 | elem = document.getElementById(id); |
30 | 30 | if (!elem) return; |
31 | - | |
32 | - var preview = nucleusConvertBreaks ? str_replace("\n","<br />",value)+" " : value+" "; | |
33 | - | |
31 | + | |
32 | + var preview = nucleusConvertBreaks ? str_replace("\n","<br />",value)+" " : value+" "; | |
33 | + | |
34 | 34 | // expand the media commands (without explicit collection) |
35 | 35 | preview = preview.replace(/\<\%image\(([^\/\|]*)\|([^\|]*)\|([^\|]*)\|([^)]*)\)\%\>/g,"<img src='"+nucleusMediaURL+nucleusAuthorId+"/$1' width='$2' height='$3' alt=\"$4\" />"); |
36 | - | |
36 | + | |
37 | 37 | // expand the media commands (with collection) |
38 | 38 | preview = preview.replace(/\<\%image\(([^\|]*)\|([^\|]*)\|([^\|]*)\|([^)]*)\)\%\>/g,"<img src='"+nucleusMediaURL+"$1' width='$2' height='$3' alt=\"$4\" />"); |
39 | 39 | preview = preview.replace(/\<\%popup\(([^\|]*)\|([^\|]*)\|([^\|]*)\|([^)]*)\)\%\>/g,"<a href='' onclick='if (event && event.preventDefault) event.preventDefault(); alert(\"popup image\"); return false;' title='popup'>$4</a>"); |
40 | - preview = preview.replace(/\<\%media\(([^\|]*)\|([^)]*)\)\%\>/g,"<a href='' title='media link'>$2</a>"); | |
41 | - | |
40 | + preview = preview.replace(/\<\%media\(([^\|]*)\|([^)]*)\)\%\>/g,"<a href='' title='media link'>$2</a>"); | |
41 | + | |
42 | 42 | elem.innerHTML = preview; |
43 | 43 | } |
44 | 44 |
@@ -51,7 +51,7 @@ function showedit() { | ||
51 | 51 | document.getElementById('edit').style.display = newval; |
52 | 52 | |
53 | 53 | if (newval == "block") |
54 | - updAllPreviews(); | |
54 | + updAllPreviews(); | |
55 | 55 | } |
56 | 56 | |
57 | 57 | function updAllPreviews() { |
@@ -70,7 +70,7 @@ function isEditVisible() { | ||
70 | 70 | function updPreview(id) { |
71 | 71 | // don't update when preview is hidden |
72 | 72 | if (!isEditVisible()) return; |
73 | - | |
73 | + | |
74 | 74 | var inputField = document.getElementById('input' + id); |
75 | 75 | if (!inputField) return; |
76 | 76 | preview('prev' + id, inputField.value); |
@@ -87,7 +87,7 @@ function str_replace(a, b, s) | ||
87 | 87 | |
88 | 88 | function shortCuts() { |
89 | 89 | if (!event || (event.ctrlKey != true)) return; |
90 | - | |
90 | + | |
91 | 91 | switch (event.keyCode) { |
92 | 92 | case 1: |
93 | 93 | ahrefThis(); break; // ctrl-shift-a |
@@ -97,7 +97,7 @@ function shortCuts() { | ||
97 | 97 | italicThis(); break; // ctrl-shift-i |
98 | 98 | case 13: |
99 | 99 | addMedia(); break; // ctrl-shift-m |
100 | - default: | |
100 | + default: | |
101 | 101 | return; |
102 | 102 | } |
103 | 103 | return; |
@@ -120,17 +120,17 @@ function ahrefThis() { | ||
120 | 120 | strSelection = document.selection.createRange().text; |
121 | 121 | else |
122 | 122 | strSelection = ''; |
123 | - | |
123 | + | |
124 | 124 | strHref = prompt("Create a link to:","http://"); |
125 | 125 | if (strHref == null) return; |
126 | - | |
126 | + | |
127 | 127 | var textpre = "<a href=\"" + strHref.replace(/&/g,'&') + "\">"; |
128 | 128 | insertAroundCaret(textpre, "</a>"); |
129 | 129 | } |
130 | 130 | |
131 | 131 | function execAndUpdate(action) { |
132 | 132 | lastSelected.caretPos.execCommand(action); |
133 | - updAllPreviews(); | |
133 | + updAllPreviews(); | |
134 | 134 | } |
135 | 135 | |
136 | 136 |
@@ -138,12 +138,12 @@ var nonie_FormType = 'body'; | ||
138 | 138 | |
139 | 139 | // Add media to new item |
140 | 140 | function addMedia() { |
141 | - | |
141 | + | |
142 | 142 | var mediapopup = window.open(nucleusMediaPopupURL + 'media.php','name', |
143 | 143 | 'status=yes,toolbar=no,scrollbars=yes,resizable=yes,width=500,height=450,top=0,left=0'); |
144 | 144 | |
145 | 145 | return; |
146 | -} | |
146 | +} | |
147 | 147 | |
148 | 148 | |
149 | 149 | function setMediaPopupURL(url) { |
@@ -156,7 +156,7 @@ function includeImage(collection, filename, type, width, height) { | ||
156 | 156 | } else { |
157 | 157 | text = getCaretText(); |
158 | 158 | } |
159 | - | |
159 | + | |
160 | 160 | // add collection name when not private collection (or editing a message that's not your) |
161 | 161 | var fullName; |
162 | 162 | if (isNaN(collection) || (nucleusAuthorId != collection)) { |
@@ -164,8 +164,8 @@ function includeImage(collection, filename, type, width, height) { | ||
164 | 164 | } else { |
165 | 165 | fullName = filename; |
166 | 166 | } |
167 | - | |
168 | - | |
167 | + | |
168 | + | |
169 | 169 | var replaceBy; |
170 | 170 | switch(type) { |
171 | 171 | case 'popup': |
@@ -175,9 +175,9 @@ function includeImage(collection, filename, type, width, height) { | ||
175 | 175 | default: |
176 | 176 | replaceBy = '<%image(' + fullName + '|'+width+'|'+height+'|' + text +')%>'; |
177 | 177 | } |
178 | - | |
178 | + | |
179 | 179 | insertAtCaret(replaceBy); |
180 | - updAllPreviews(); | |
180 | + updAllPreviews(); | |
181 | 181 | |
182 | 182 | } |
183 | 183 |
@@ -188,19 +188,19 @@ function includeOtherMedia(collection, filename) { | ||
188 | 188 | } else { |
189 | 189 | text = getCaretText(); |
190 | 190 | } |
191 | - | |
191 | + | |
192 | 192 | // add collection name when not private collection (or editing a message that's not your) |
193 | 193 | var fullName; |
194 | 194 | if (isNaN(collection) || (nucleusAuthorId != collection)) { |
195 | 195 | fullName = collection + '/' + filename; |
196 | 196 | } else { |
197 | 197 | fullName = filename; |
198 | - } | |
199 | - | |
198 | + } | |
199 | + | |
200 | 200 | var replaceBy = '<%media(' + fullName + '|' + text +')%>'; |
201 | - | |
201 | + | |
202 | 202 | insertAtCaret(replaceBy); |
203 | - updAllPreviews(); | |
203 | + updAllPreviews(); | |
204 | 204 | } |
205 | 205 | |
206 | 206 |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | 2 | * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) |
3 | - * Copyright (C) 2002-2007 The Nucleus Group | |
3 | + * Copyright (C) 2002-2005 The Nucleus Group | |
4 | 4 | * |
5 | 5 | * This program is free software; you can redistribute it and/or |
6 | 6 | * modify it under the terms of the GNU General Public License |
@@ -11,8 +11,8 @@ | ||
11 | 11 | * script the check (on the clientside) if a entered value |
12 | 12 | * is a valid number and remove the invalid chars |
13 | 13 | * |
14 | - * $Id: numbercheck.js,v 1.2.2.1 2007-03-27 11:27:16 kimitake Exp $ | |
15 | - * $NucleusJP: numbercheck.js,v 1.4 2007/02/04 06:28:45 kimitake Exp $ | |
14 | + * $Id: numbercheck.js,v 1.2.2.2 2007-03-27 11:47:14 kimitake Exp $ | |
15 | + * $NucleusJP: numbercheck.js,v 1.2 2005/03/16 08:07:50 kimitake Exp $ | |
16 | 16 | */ |
17 | 17 | |
18 | 18 | function checkNumeric(f) |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) |
3 | - * Copyright (C) 2002-2007 The Nucleus Group | |
3 | + * Copyright (C) 2002-2005 The Nucleus Group | |
4 | 4 | * |
5 | 5 | * This program is free software; you can redistribute it and/or |
6 | 6 | * modify it under the terms of the GNU General Public License |
@@ -8,8 +8,8 @@ | ||
8 | 8 | * of the License, or (at your option) any later version. |
9 | 9 | * (see nucleus/documentation/index.html#license for more info) |
10 | 10 | * |
11 | - * $Id: opennew.js,v 1.3.2.1 2007-03-27 11:27:16 kimitake Exp $ | |
12 | - * $NucleusJP: opennew.js,v 1.5 2007/02/04 06:28:45 kimitake Exp $ | |
11 | + * $Id: opennew.js,v 1.3.2.2 2007-03-27 11:47:14 kimitake Exp $ | |
12 | + * $NucleusJP: opennew.js,v 1.3 2005/03/16 08:07:50 kimitake Exp $ | |
13 | 13 | * |
14 | 14 | * JavaScript to open non-local links in a new window. |
15 | 15 | * |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /** |
2 | 2 | * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) |
3 | - * Copyright (C) 2002-2007 The Nucleus Group | |
3 | + * Copyright (C) 2002-2005 The Nucleus Group | |
4 | 4 | * |
5 | 5 | * This program is free software; you can redistribute it and/or |
6 | 6 | * modify it under the terms of the GNU General Public License |
@@ -12,8 +12,8 @@ | ||
12 | 12 | * |
13 | 13 | * @require compatibility.js |
14 | 14 | * |
15 | - * $Id: templateEdit.js,v 1.3.2.1 2007-03-27 11:27:16 kimitake Exp $ | |
16 | - * $NucleusJP: templateEdit.js,v 1.5 2007/02/04 06:28:45 kimitake Exp $ | |
15 | + * $Id: templateEdit.js,v 1.3.2.2 2007-03-27 11:47:14 kimitake Exp $ | |
16 | + * $NucleusJP: templateEdit.js,v 1.3 2005/03/16 08:07:50 kimitake Exp $ | |
17 | 17 | */ |
18 | 18 | |
19 | 19 | var amountOfFields = 1; |
@@ -64,4 +64,4 @@ function makeVisible(i) { | ||
64 | 64 | return false; |
65 | 65 | } |
66 | 66 | |
67 | -window.onload = hideUnused; | |
\ No newline at end of file | ||
67 | +window.onload = hideUnused; |
@@ -12,27 +12,6 @@ | ||
12 | 12 | // Fully translated language file can be sent to us and will be made |
13 | 13 | // available for download (with proper credit to the author, of course) |
14 | 14 | |
15 | -// START changed/added after 3.3 START | |
16 | -define('_AUTOSAVEDRAFT', 'Auto save draft'); | |
17 | -define('_AUTOSAVEDRAFT_LASTSAVED', 'Last saved: '); | |
18 | -define('_AUTOSAVEDRAFT_NOTYETSAVED', 'No saves have been made yet'); | |
19 | -define('_AUTOSAVEDRAFT_NOW', 'Auto save now'); | |
20 | -define('_SKIN_PARTS_SPECIAL', 'Special skin parts'); | |
21 | -define('_ERROR_SKIN_PARTS_SPECIAL_FORMAT', 'You must enter a name that exists only out of lowercase letters and digits'); | |
22 | -define('_ERROR_SKIN_PARTS_SPECIAL_DELETE', 'Can\'t delete this skin part'); | |
23 | -define('_CONFIRMTXT_SKIN_PARTS_SPECIAL', 'Do you really want to delete this special skin part?'); | |
24 | -define('_ERROR_PLUGIN_LOAD', 'Plugin could not be loaded, or does not support certain features that are required for it to run on your Nucleus installation (you might want to check the <a href="?action=actionlog">actionlog</a> for more info)'); | |
25 | -// END changed/added after 3.3 END | |
26 | - | |
27 | -// START changed/added after 3.22 START | |
28 | -define('_SEARCHFORM_QUERY', 'Keywords to search'); | |
29 | -define('_ERROR_EMAIL_REQUIRED', 'Email address is required'); | |
30 | -define('_COMMENTFORM_MAIL', 'Website:'); | |
31 | -define('_COMMENTFORM_EMAIL', 'E-mail:'); | |
32 | -define('_EBLOG_REQUIREDEMAIL', 'Require E-mail address with comments?'); | |
33 | -define('_ERROR_COMMENTS_SPAM', 'Your comment was rejected because it did not pass the spam test'); | |
34 | -// END changed/added after 3.22 END | |
35 | - | |
36 | 15 | // START changed/added after 3.15 START |
37 | 16 | |
38 | 17 | define('_LIST_PLUG_SUBS_NEEDUPDATE','Please use the \'Update Subscription list\'-button to update the plugin\'s subscription list.'); |
@@ -119,12 +98,12 @@ define('_BATCH_EXEC', 'Execute'); | ||
119 | 98 | define('_QMENU_HOME', 'Home'); |
120 | 99 | define('_QMENU_ADD', 'Add Item'); |
121 | 100 | define('_QMENU_ADD_SELECT', '-- select --'); |
122 | -define('_QMENU_USER_SETTINGS', 'Profile'); | |
101 | +define('_QMENU_USER_SETTINGS', 'Settings'); | |
123 | 102 | define('_QMENU_USER_ITEMS', 'Items'); |
124 | 103 | define('_QMENU_USER_COMMENTS', 'Comments'); |
125 | 104 | define('_QMENU_MANAGE', 'Management'); |
126 | 105 | define('_QMENU_MANAGE_LOG', 'Action Log'); |
127 | -define('_QMENU_MANAGE_SETTINGS', 'Configuration'); | |
106 | +define('_QMENU_MANAGE_SETTINGS', 'Global Settings'); | |
128 | 107 | define('_QMENU_MANAGE_MEMBERS', 'Members'); |
129 | 108 | define('_QMENU_MANAGE_NEWBLOG', 'New Weblog'); |
130 | 109 | define('_QMENU_MANAGE_BACKUPS', 'Backups'); |
@@ -466,13 +445,14 @@ define('_LOGIN_PLEASE', 'Please Log in First'); | ||
466 | 445 | // commentform |
467 | 446 | define('_COMMENTFORM_YOUARE', 'You are'); |
468 | 447 | define('_COMMENTFORM_SUBMIT', 'Add Comment'); |
469 | -define('_COMMENTFORM_COMMENT', 'Your comment:'); | |
470 | -define('_COMMENTFORM_NAME', 'Name:'); | |
448 | +define('_COMMENTFORM_COMMENT', 'Your comment'); | |
449 | +define('_COMMENTFORM_NAME', 'Name'); | |
450 | +define('_COMMENTFORM_MAIL', 'E-mail/HTTP'); | |
471 | 451 | define('_COMMENTFORM_REMEMBER', 'Remember Me'); |
472 | 452 | |
473 | 453 | // loginform |
474 | -define('_LOGINFORM_NAME', 'Username:'); | |
475 | -define('_LOGINFORM_PWD', 'Password:'); | |
454 | +define('_LOGINFORM_NAME', 'Username'); | |
455 | +define('_LOGINFORM_PWD', 'Password'); | |
476 | 456 | define('_LOGINFORM_YOUARE', 'Logged in as'); |
477 | 457 | define('_LOGINFORM_SHARED', 'Shared Computer'); |
478 | 458 |
@@ -575,7 +555,7 @@ define('_ERROR_BADSHORTBLOGNAME', 'The short blog name should only contain a-z a | ||
575 | 555 | define('_ERROR_DUPSHORTBLOGNAME', 'Another blog already has the chosen short name. These names should be unique'); |
576 | 556 | define('_ERROR_UPDATEFILE', 'Cannot get write access to the update-file. Make sure the file permissions are set ok (try chmodding it to 666). Also note that the location is relative to the admin-area directory, so you might want to use an absolute path (something like /your/path/to/nucleus/)'); |
577 | 557 | define('_ERROR_DELDEFBLOG', 'Cannot delete the default blog'); |
578 | -define('_ERROR_DELETEMEMBER', 'This member cannot be deleted, probably because he/she is the author of item(s)'); | |
558 | +define('_ERROR_DELETEMEMBER', 'This member cannot be deleted, probably because she is the author of items or comments'); | |
579 | 559 | define('_ERROR_BADTEMPLATENAME', 'Invalid name for template, use only a-z and 0-9, without spaces'); |
580 | 560 | define('_ERROR_DUPTEMPLATENAME', 'Another template with this name already exists'); |
581 | 561 | define('_ERROR_BADSKINNAME', 'Invalid name for skin (only a-z, 0-9 are allowed, no spaces)'); |
@@ -13,7 +13,7 @@ | ||
13 | 13 | /** |
14 | 14 | * @license http://nucleuscms.org/license.txt GNU General Public License |
15 | 15 | * @copyright Copyright (C) 2002-2005 The Nucleus Group |
16 | - * @version $Id: globalfunctions.php,v 1.6.2.7 2006-12-18 20:34:49 kimitake Exp $ | |
16 | + * @version $Id: globalfunctions.php,v 1.6.2.8 2007-03-27 11:47:31 kimitake Exp $ | |
17 | 17 | * @version $NucleusJP: globalfunctions.php,v 1.6.2.6 2006/11/17 07:59:29 kimitake Exp $ |
18 | 18 | */ |
19 | 19 |
@@ -1283,7 +1283,7 @@ function serverStringToArray($str, &$array, &$frontParam) | ||
1283 | 1283 | |
1284 | 1284 | // split front param, e.g. /index.php, and others, e.g. blogid=1&page=2 |
1285 | 1285 | if (strstr($str, "?")){ |
1286 | - list($frontParam, $args) = preg_split("/\?/", $str, 2); | |
1286 | + list($frontParam, $args) = preg_split("/\?/", $str); | |
1287 | 1287 | } |
1288 | 1288 | else { |
1289 | 1289 | $args = $str; |
@@ -1329,7 +1329,7 @@ function sanitizeArray(&$array) | ||
1329 | 1329 | foreach ($array as $k => $v) { |
1330 | 1330 | |
1331 | 1331 | // split to key and value |
1332 | - list($key, $val) = preg_split("/=/", $v, 2); | |
1332 | + list($key, $val) = preg_split("/=/", $v); | |
1333 | 1333 | if (!isset($val)) { |
1334 | 1334 | continue; |
1335 | 1335 | } |
@@ -1381,7 +1381,7 @@ function convArrayForSanitizing($src, &$array) | ||
1381 | 1381 | function revertArrayForSanitizing($array, &$dst) |
1382 | 1382 | { |
1383 | 1383 | foreach ($array as $v) { |
1384 | - list($key, $val) = preg_split("/=/", $v, 2); | |
1384 | + list($key, $val) = preg_split("/=/", $v); | |
1385 | 1385 | $dst[$key] = $val; |
1386 | 1386 | } |
1387 | 1387 | } |
@@ -2,24 +2,19 @@ | ||
2 | 2 | |
3 | 3 | <%init%> |
4 | 4 | <script type="text/javascript" src="javascript/numbercheck.js"></script> |
5 | -<script type="text/javascript" src="javascript/xmlhttprequest.js"></script> | |
6 | 5 | |
7 | -<form id="addform" method="post" action="index.php" > | |
6 | +<form method="post" action="index.php" > | |
8 | 7 | |
9 | 8 | <div> |
10 | 9 | |
11 | 10 | <input type="hidden" name="action" value="additem" /> |
12 | 11 | <input name="blogid" value="<%blogid%>" type="hidden" /> |
13 | -<input type="hidden" name="draftid" value="0" /> | |
14 | 12 | <%ticket%> |
15 | 13 | |
16 | 14 | <table> |
17 | 15 | <tr> |
18 | 16 | <th colspan="2"><%text(_ADD_CREATENEW)%></th> |
19 | 17 | </tr><tr> |
20 | - <td><%text(_AUTOSAVEDRAFT)%></td> | |
21 | - <td><span id="info"><%text(_AUTOSAVEDRAFT_NOTYETSAVED)%></span></td> | |
22 | - </tr><tr> | |
23 | 18 | <td><%text(_ADD_TITLE)%></td> |
24 | 19 | <td><input |
25 | 20 | <%jsinput(title)%> |
@@ -42,9 +37,9 @@ | ||
42 | 37 | </td> |
43 | 38 | </tr><tr id="edit" style="display:none;"> |
44 | 39 | <td><%text(_ADD_PREVIEW)%></td> |
45 | - <td><b><span id="prevtitle"> </span></b><br /> | |
46 | - <span id="prevbody"> </span><br /> | |
47 | - <span id="prevmore"> </span><br /> | |
40 | + <td><b><span id="prevtitle"></span></b><br /> | |
41 | + <span id="prevbody"></span><br /> | |
42 | + <span id="prevmore"></span><br /> | |
48 | 43 | </td> |
49 | 44 | </tr><tr> |
50 | 45 |
@@ -116,24 +111,9 @@ | ||
116 | 111 | <td> |
117 | 112 | <input tabindex="60" type="submit" value="<%text(_ADD_ADDITEM)%>" |
118 | 113 | onclick="return checkSubmit();" /> |
119 | - <input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>" | |
120 | - onclick="autoSaveDraft();" /> | |
121 | 114 | </td> |
122 | 115 | </tr> |
123 | 116 | </table> |
124 | 117 | |
125 | 118 | </div> |
126 | -</form> | |
127 | - | |
128 | -<script type="text/javascript"> | |
129 | - var xmlhttprequest = new Array(); | |
130 | - xmlhttprequest[0] = createHTTPHandler(); // AutoDraft handler | |
131 | - xmlhttprequest[1] = createHTTPHandler(); // UpdateTicket handler | |
132 | - var seconds = now(); // Last AutoDraft time | |
133 | - var checks = 0; // Number of checks since last AutoDraft | |
134 | - var addform = document.getElementById('addform'); // The form id | |
135 | - var goal = document.getElementById('info'); // The html div id where 'Last saved: date time' must come | |
136 | - var goalurl = '../action.php'; // The PHP file where the content must be posted to | |
137 | - var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved' | |
138 | - var formtype = 'add'; // Add or edit form | |
139 | -</script> | |
119 | +</form> |
@@ -2,22 +2,17 @@ | ||
2 | 2 | |
3 | 3 | <%init%> |
4 | 4 | <script type="text/javascript" src="javascript/numbercheck.js"></script> |
5 | -<script type="text/javascript" src="javascript/xmlhttprequest.js"></script> | |
6 | 5 | |
7 | -<form id="editform" method="post" action="index.php"> | |
6 | +<form method="post" action="index.php"> | |
8 | 7 | <div> |
9 | 8 | |
10 | 9 | <input type="hidden" name="action" value="itemupdate" /> |
11 | 10 | <input name="itemid" value="<%contents(itemid)%>" type="hidden" /> |
12 | -<input type="hidden" name="draftid" value="0" /> | |
13 | 11 | <%ticket%> |
14 | 12 | |
15 | 13 | <table><tr> |
16 | 14 | <th colspan="2"><%text(_EDIT_ITEM)%></th> |
17 | 15 | </tr><tr> |
18 | - <td><%text(_AUTOSAVEDRAFT)%></td> | |
19 | - <td><span id="info"><%text(_AUTOSAVEDRAFT_NOTYETSAVED)%></span></td> | |
20 | -</tr><tr> | |
21 | 16 | <td><%text(_EDIT_ORIG_AUTHOR)%></td> |
22 | 17 | <td><%contents(author)%></td> |
23 | 18 | </tr><tr> |
@@ -43,9 +38,9 @@ | ||
43 | 38 | </td> |
44 | 39 | </tr><tr id="edit" style="display:none;"> |
45 | 40 | <td><%text(_ADD_PREVIEW)%></td> |
46 | - <td><b><span id="prevtitle"> </span></b><br /> | |
47 | - <span id="prevbody"> </span><br /> | |
48 | - <span id="prevmore"> </span><br /> | |
41 | + <td><b><span id="prevtitle"></span></b><br /> | |
42 | + <span id="prevbody"></span><br /> | |
43 | + <span id="prevmore"></span><br /> | |
49 | 44 | </td> |
50 | 45 | </tr><tr> |
51 | 46 |
@@ -77,13 +72,13 @@ | ||
77 | 72 | <input name="actiontype" value="addfuture" type="radio" id="act_future" tabindex="61" /><label for="act_future"><%text(_ADD_ADDLATER)%></label> <%helplink(future)%> |
78 | 73 | <div class="indent"> |
79 | 74 | <%text(_ADD_PLACE_ON)%> |
80 | - <input id="inputyear" name="year" tabindex="71" size="4" value="<%currenttime(year)%>" />/ | |
75 | + <input id="inputday" name="day" tabindex="71" size="2" value="<%currenttime(mday)%>" />/ | |
81 | 76 | <input id="inputmonth" name="month" tabindex="72" size="2" value="<%currenttime(mon)%>" />/ |
82 | - <input id="inputday" name="day" tabindex="73" size="2" value="<%currenttime(mday)%>" /> | |
83 | - | |
77 | + <input id="inputyear" name="year" tabindex="73" size="4" value="<%currenttime(year)%>" /> | |
78 | + at | |
84 | 79 | <input id="inputhour" name="hour" tabindex="74" size="2" value="<%currenttime(hours)%>" />: |
85 | 80 | <input id="inputminutes" name="minutes" tabindex="75" size="2" value="<%currenttime(minutes)%>" /> |
86 | - (yyyy/mm/dd hh:mm) | |
81 | + (dd/mm/yyyy hh:mm) | |
87 | 82 | <%ifblogsetting(ballowpast,0)%> |
88 | 83 | <br /> |
89 | 84 | <%text(_ADD_NOPASTDATES)%> |
@@ -143,24 +138,9 @@ | ||
143 | 138 | <td> |
144 | 139 | <input tabindex="60" type="submit" value="<%text(_EDIT_SUBMIT)%>" |
145 | 140 | onclick="return checkSubmit();" /> |
146 | - <input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>" | |
147 | - onclick="autoSaveDraft();" /> | |
148 | 141 | </td> |
149 | 142 | |
150 | 143 | </tr></table> |
151 | 144 | |
152 | 145 | </div> |
153 | -</form> | |
154 | - | |
155 | -<script type="text/javascript"> | |
156 | - var xmlhttprequest = new Array(); | |
157 | - xmlhttprequest[0] = createHTTPHandler(); // AutoDraft handler | |
158 | - xmlhttprequest[1] = createHTTPHandler(); // UpdateTicket handler | |
159 | - var seconds = now(); // Last AutoDraft time | |
160 | - var checks = 0; // Number of checks since last AutoDraft | |
161 | - var addform = document.getElementById('editform'); // The form id | |
162 | - var goal = document.getElementById('info'); // The html div id where 'Last saved: date time' must come | |
163 | - var goalurl = '../action.php'; // The PHP file where the content must be posted to | |
164 | - var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved' | |
165 | - var formtype = 'edit'; // Add or edit form | |
166 | -</script> | |
146 | +</form> |
@@ -7,7 +7,6 @@ | ||
7 | 7 | <script type="text/javascript" src="javascript/bookmarklet.js"></script> |
8 | 8 | <script type="text/javascript" src="javascript/edit.js"></script> |
9 | 9 | <script type="text/javascript" src="javascript/numbercheck.js"></script> |
10 | - <script type="text/javascript" src="javascript/xmlhttprequest.js"></script> | |
11 | 10 | <%init%> |
12 | 11 | <%extrahead%> |
13 | 12 | <script type="text/javascript"> |
@@ -25,11 +24,10 @@ | ||
25 | 24 | </head> |
26 | 25 | <body> |
27 | 26 | <h1><%text(_ADD_ADDTO)%> '<%bloglink%>'</h1> |
28 | - <form id="addform" method="post" action="bookmarklet.php" ><div> | |
27 | + <form method="post" action="bookmarklet.php" ><div> | |
29 | 28 | |
30 | 29 | <input name="action" type="hidden" value="additem" /> |
31 | 30 | <input name="blogid" type="hidden" value="<%blogid%>" /> |
32 | - <input type="hidden" name="draftid" value="0" /> | |
33 | 31 | <%ticket%> |
34 | 32 | |
35 | 33 | <div id="submit" class="buttonbar"> |
@@ -46,10 +44,6 @@ | ||
46 | 44 | |
47 | 45 | <table> |
48 | 46 | <tr> |
49 | - <td><%text(_AUTOSAVEDRAFT)%></td> | |
50 | - <td><span id="info"><%text(_AUTOSAVEDRAFT_NOTYETSAVED)%></span></td> | |
51 | - </tr> | |
52 | - <tr> | |
53 | 47 | <td><%text(_ADD_TITLE)%></td> |
54 | 48 | <td> |
55 | 49 | <input |
@@ -71,12 +65,7 @@ | ||
71 | 65 | <tr><td> |
72 | 66 | <%text(_ADD_CATEGORY)%></td> |
73 | 67 | <td><%categories%></td> |
74 | - </tr> | |
75 | - <tr> | |
76 | - <td><%text(_AUTOSAVEDRAFT_NOW)%></td> | |
77 | - <td><input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>" onclick="autoSaveDraft();" /></td> | |
78 | - </tr> | |
79 | - </table> | |
68 | + </tr></table> | |
80 | 69 | |
81 | 70 | |
82 | 71 | </div> |
@@ -144,28 +133,14 @@ | ||
144 | 133 | <div id="preview" class="contentblock"> |
145 | 134 | <h2><%text(_ADD_PREVIEW)%></h2> |
146 | 135 | |
147 | - <b><span id="prevtitle"> </span></b> | |
136 | + <b><span id="prevtitle"></span></b> | |
148 | 137 | <br /> |
149 | - <span id="prevbody"> </span> | |
138 | + <span id="prevbody"></span> | |
150 | 139 | <br /> |
151 | - <span id="prevmore"> </span> | |
140 | + <span id="prevmore"></span> | |
152 | 141 | </div> |
153 | 142 | |
154 | 143 | </div></form> |
155 | - | |
156 | - <script type="text/javascript"> | |
157 | - var xmlhttprequest = new Array(); | |
158 | - xmlhttprequest[0] = createHTTPHandler(); // AutoDraft handler | |
159 | - xmlhttprequest[1] = createHTTPHandler(); // UpdateTicket handler | |
160 | - var seconds = now(); // Last AutoDraft time | |
161 | - var checks = 0; // Number of checks since last AutoDraft | |
162 | - var addform = document.getElementById('addform'); // The form id | |
163 | - var goal = document.getElementById('info'); // The html div id where 'Last saved: date time' must come | |
164 | - var goalurl = '../action.php'; // The PHP file where the content must be posted to | |
165 | - var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved' | |
166 | - var formtype = 'add'; // Add or edit form | |
167 | - </script> | |
168 | - | |
169 | 144 | </body> |
170 | 145 | </html> |
171 | 146 |
@@ -7,7 +7,6 @@ | ||
7 | 7 | <script type="text/javascript" src="javascript/bookmarklet.js"></script> |
8 | 8 | <script type="text/javascript" src="javascript/edit.js"></script> |
9 | 9 | <script type="text/javascript" src="javascript/numbercheck.js"></script> |
10 | - <script type="text/javascript" src="javascript/xmlhttprequest.js"></script> | |
11 | 10 | <%init%> |
12 | 11 | <%extrahead%> |
13 | 12 | <script type="text/javascript"> |
@@ -25,11 +24,10 @@ | ||
25 | 24 | </head> |
26 | 25 | <body> |
27 | 26 | <h1><%text(_EDIT_ITEM)%> (<%contents(itemid)%>)</h1> |
28 | - <form id="editform" method="post" action="bookmarklet.php" ><div> | |
27 | + <form method="post" action="bookmarklet.php" ><div> | |
29 | 28 | |
30 | 29 | <input name="action" type="hidden" value="edititem" /> |
31 | 30 | <input name="itemid" type="hidden" value="<%contents(itemid)%>" /> |
32 | - <input type="hidden" name="draftid" value="0" /> | |
33 | 31 | <%ticket%> |
34 | 32 | |
35 | 33 | <div id="submit" class="buttonbar"> |
@@ -45,10 +43,6 @@ | ||
45 | 43 | <div id="body" class="contentblock"> |
46 | 44 | <table> |
47 | 45 | <tr> |
48 | - <td><%text(_AUTOSAVEDRAFT)%></td> | |
49 | - <td><span id="info"><%text(_AUTOSAVEDRAFT_NOTYETSAVED)%></span></td> | |
50 | - </tr> | |
51 | - <tr> | |
52 | 46 | <td><%text(_ADD_TITLE)%></td> |
53 | 47 | <td><input |
54 | 48 | <%jsinput(title)%> |
@@ -70,10 +64,6 @@ | ||
70 | 64 | <td><%text(_ADD_CATEGORY)%></td> |
71 | 65 | <td><%categories%></td> |
72 | 66 | </tr> |
73 | - <tr> | |
74 | - <td><%text(_AUTOSAVEDRAFT_NOW)%></td> | |
75 | - <td><input tabindex="80" type="button" name="autosavenow" value="<%text(_AUTOSAVEDRAFT_NOW)%>" onclick="autoSaveDraft();" /></td> | |
76 | - </tr> | |
77 | 67 | </table> |
78 | 68 | |
79 | 69 | </div> |
@@ -140,28 +130,14 @@ | ||
140 | 130 | <div id="preview" class="contentblock"> |
141 | 131 | <h2><%text(_ADD_PREVIEW)%></h2> |
142 | 132 | |
143 | - <b><span id="prevtitle"> </span></b> | |
133 | + <b><span id="prevtitle"></span></b> | |
144 | 134 | <br /> |
145 | - <span id="prevbody"> </span> | |
135 | + <span id="prevbody"></span> | |
146 | 136 | <br /> |
147 | - <span id="prevmore"> </span> | |
137 | + <span id="prevmore"></span> | |
148 | 138 | </div> |
149 | 139 | |
150 | 140 | </div></form> |
151 | - | |
152 | - <script type="text/javascript"> | |
153 | - var xmlhttprequest = new Array(); | |
154 | - xmlhttprequest[0] = createHTTPHandler(); // AutoDraft handler | |
155 | - xmlhttprequest[1] = createHTTPHandler(); // UpdateTicket handler | |
156 | - var seconds = now(); // Last AutoDraft time | |
157 | - var checks = 0; // Number of checks since last AutoDraft | |
158 | - var addform = document.getElementById('editform'); // The form id | |
159 | - var goal = document.getElementById('info'); // The html div id where 'Last saved: date time' must come | |
160 | - var goalurl = '../action.php'; // The PHP file where the content must be posted to | |
161 | - var lastsavedtext = '<%text(_AUTOSAVEDRAFT_LASTSAVED)%>'; // The language variable for 'Last saved' | |
162 | - var formtype = 'edit'; // Add or edit form | |
163 | - </script> | |
164 | - | |
165 | 141 | </body> |
166 | 142 | </html> |
167 | 143 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | <?php |
2 | -$mbemu_internals['sjistoeuc_byte1'] = array( | |
2 | +$_sjistoeuc_byte1 = array( | |
3 | 3 | 129 => 161 ,130 => 163 ,131 => 165 ,132 => 167 ,133 => 169 ,134 => 171 , |
4 | 4 | 135 => 173 ,136 => 175 ,137 => 177 ,138 => 179 ,139 => 181 ,140 => 183 , |
5 | 5 | 141 => 185 ,142 => 187 ,143 => 189 ,144 => 191 ,145 => 193 ,146 => 195 , |
@@ -9,7 +9,7 @@ $mbemu_internals['sjistoeuc_byte1'] = array( | ||
9 | 9 | 229 => 233 ,230 => 235 ,231 => 237 ,232 => 239 ,233 => 241 ,234 => 243 , |
10 | 10 | 235 => 245 ,236 => 247 ,237 => 249 ,238 => 251 ,239 => 253 ,240 => 255 ); |
11 | 11 | |
12 | -$mbemu_internals['sjistoeuc_byte2'] = array( | |
12 | +$_sjistoeuc_byte2 = array( | |
13 | 13 | 0 => array( |
14 | 14 | 64 => 161 ,65 => 162 ,66 => 163 ,67 => 164 ,68 => 165 ,69 => 166 , |
15 | 15 | 70 => 167 ,71 => 168 ,72 => 169 ,73 => 170 ,74 => 171 ,75 => 172 , |
@@ -46,7 +46,7 @@ $mbemu_internals['sjistoeuc_byte2'] = array( | ||
46 | 46 | 245 => 247 ,246 => 248 ,247 => 249 ,248 => 250 ,249 => 251 ,250 => 252 , |
47 | 47 | 251 => 253 ,252 => 254 )); |
48 | 48 | |
49 | -$mbemu_internals['sjistoeuc_byte1_shift'] = array ( | |
49 | +$_sjistoeuc_byte1_shift = array ( | |
50 | 50 | 64 => 0 ,65 => 0 ,66 => 0 ,67 => 0 ,68 => 0 ,69 => 0 , |
51 | 51 | 70 => 0 ,71 => 0 ,72 => 0 ,73 => 0 ,74 => 0 ,75 => 0 , |
52 | 52 | 76 => 0 ,77 => 0 ,78 => 0 ,79 => 0 ,80 => 0 ,81 => 0 , |
@@ -80,7 +80,7 @@ $mbemu_internals['sjistoeuc_byte1_shift'] = array ( | ||
80 | 80 | 245 => 1 ,246 => 1 ,247 => 1 ,248 => 1 ,249 => 1 ,250 => 1 , |
81 | 81 | 251 => 1 ,252 => 1 ); |
82 | 82 | |
83 | -$mbemu_internals['euctosjis_byte1'] = array( | |
83 | +$_euctosjis_byte1 = array( | |
84 | 84 | 161 => 129, 162 => 129, 163 => 130, 164 => 130, 165 => 131, |
85 | 85 | 166 => 131, 167 => 132, 168 => 132, 169 => 133, 170 => 133, |
86 | 86 | 171 => 134, 172 => 134, 173 => 135, 174 => 135, 175 => 136, |
@@ -101,7 +101,7 @@ $mbemu_internals['euctosjis_byte1'] = array( | ||
101 | 101 | 246 => 235, 247 => 236, 248 => 236, 249 => 237, 250 => 237, |
102 | 102 | 251 => 238, 252 => 238, 253 => 239, 254 => 239, 255 => 240); |
103 | 103 | |
104 | -$mbemu_internals['euctosjis_byte2'] = array( | |
104 | +$_euctosjis_byte2 = array( | |
105 | 105 | 0 => array( |
106 | 106 | 161 => 64, 162 => 65, 163 => 66, 164 => 67, 165 => 68, |
107 | 107 | 166 => 69, 167 => 70, 168 => 71, 169 => 72, 170 => 73, |
@@ -143,7 +143,7 @@ $mbemu_internals['euctosjis_byte2'] = array( | ||
143 | 143 | 246 => 244, 247 => 245, 248 => 246, 249 => 247, 250 => 248, |
144 | 144 | 251 => 249, 252 => 250, 253 => 251, 254 => 252)); |
145 | 145 | |
146 | -$mbemu_internals['alphanumeric_convert'] = array ( | |
146 | +$alphanumeric_convert = array ( | |
147 | 147 | 0x20 => "\xa1\xa1",0x21 => "\xa1\xaa",0x23 => "\xa1\xf4",0x24 => |
148 | 148 | "\xa1\xf0",0x25 => "\xa1\xf3", |
149 | 149 | 0x26 => "\xa1\xf5",0x28 => "\xa1\xca",0x29 => "\xa1\xcb",0x2a => "\xa1\xf6", |
@@ -169,7 +169,7 @@ $mbemu_internals['alphanumeric_convert'] = array ( | ||
169 | 169 | 0x79 => "\xa3\xf9",0x7a => "\xa3\xfa",0x7b => "\xa1\xd0",0x7c => "\xa1\xc3", |
170 | 170 | 0x7d => "\xa1\xd1"); |
171 | 171 | |
172 | -$mbemu_internals['kana_zenhan_convert'] = array ( | |
172 | +$kana_zenhan_convert = array ( | |
173 | 173 | 0xa1 => "\xa7",0xa2 => "\xb1",0xa3 => "\xa8",0xa4 => "\xb2", |
174 | 174 | 0xa5 => "\xa9",0xa6 => "\xb3",0xa7 => "\xaa",0xa8 => "\xb4", |
175 | 175 | 0xa9 => "\xab",0xaa => "\xb5",0xab => "\xb6",0xac => "\xb6\x8e\xde", |
@@ -195,7 +195,7 @@ $mbemu_internals['kana_zenhan_convert'] = array ( | ||
195 | 195 | 0xee => "\xdc",0xf0 => "\xb2",0xf1 => "\xb4",0xf2 => "\xa6",0xf3 => "\xdd", |
196 | 196 | 0xf4 => "\xb3\x8e\xde"); |
197 | 197 | |
198 | -$mbemu_internals['special_zenhan_convert'] = array( | |
198 | +$special_zenhan_convert = array( | |
199 | 199 | 0xa2 => "\xa4",0xa3 => "\xa1",0xa6 => "\xa5",0xab => "\xde", |
200 | 200 | 0xac => "\xdf",0xbc => "\xb0",0xd6 => "\xa2",0xd7 => "\xa3"); |
201 | 201 |
@@ -1,1031 +1,495 @@ | ||
1 | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | -<html> | |
3 | -<head> | |
4 | - | |
5 | - <meta http-equiv="CONTENT-TYPE" content="text/html; charset=shift_jis"> | |
6 | - <title>変更履歴</title> | |
7 | - | |
8 | - | |
9 | - <meta name="GENERATOR" content="OpenOffice.org 1.1.3 (Win32)"> | |
10 | - | |
11 | - <meta name="CREATED" content="20050130;2310982"> | |
12 | - | |
13 | - <meta name="CHANGED" content="20050130;2372139"> | |
14 | - | |
15 | -</head> | |
16 | - | |
17 | - | |
18 | -<body style="direction: ltr;" lang="ja-JP"> | |
19 | - | |
20 | -<h2>変更履歴</h2> | |
21 | - | |
22 | -<h3><font face="Times New Roman, serif"><span lang="en-US">mbstringエミュレータ for Japanese Ver.0.84</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2006/1/23</span></font>)</h3> | |
23 | - | |
24 | -<ul> | |
25 | - | |
26 | - <li>シフトJISで半角カンマの処理がおかしかったのを修正しました</li> | |
27 | -</ul> | |
28 | - | |
29 | -<h3><font face="Times New Roman, serif"><span lang="en-US">mbstringエミュレータ for Japanese Ver.0.83</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2005/12/15</span></font>)</h3> | |
30 | - | |
31 | -<ul> | |
32 | - | |
33 | - <li>mb_send_mailでmb_languageがjaだったときに対応しました</li> | |
34 | - <li>mb_send_mailで日本語処理の最後にbreakがなかったので加えました</li> | |
35 | -</ul> | |
36 | - | |
37 | -<h3><font face="Times New Roman, serif"><span lang="en-US">mbstringエミュレータ for Japanese Ver.0.82</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2005/11/28</span></font>)</h3> | |
38 | - | |
39 | -<ul> | |
40 | - | |
41 | - <li>mb_languageでパラメータがなかった場合にwarningが出てしまうのを修正しました</li> | |
42 | - <li>mb_send_mail内部で_is_encodedを呼び出しているのを_check_encodingを呼ぶように修正しました</li> | |
43 | -</ul> | |
44 | - | |
45 | -<h3><font face="Times New Roman, serif"><span lang="en-US">mbstringエミュレータ for Japanese Ver.0.81</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2005/10/09</span></font>)</h3> | |
46 | - | |
47 | -<ul> | |
48 | - | |
49 | - <li>$jis_matchが未定義だったバグを修正しました</li> | |
50 | -</ul> | |
51 | - | |
52 | -<h3><font face="Times New Roman, serif"><span lang="en-US">mbstringエミュレータ for Japanese Ver.0.8</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2005/8/23</span></font>)</h3> | |
53 | - | |
54 | -<ul> | |
55 | - | |
56 | - <li>名称をmbstringエミュレータ for Japaneseに変更しました</li> | |
57 | - <li> | |
58 | -mb_substitute_characterサポートしました | |
59 | - </li> | |
60 | - | |
61 | - <li> | |
62 | -mb_convert_caseサポートしました | |
63 | - </li> | |
64 | - | |
65 | - <li> | |
66 | -mb_get_infoサポートしました | |
67 | - </li> | |
68 | - | |
69 | - <li> | |
70 | -mb_strtolowerサポートしました | |
71 | - </li> | |
72 | - | |
73 | - <li> | |
74 | -mb_strtoupperサポートしました</li> | |
75 | - <li>MB_CASE_UPPER,MB_CASE_LOWER,MB_CASE_CASEを定義しました</li> | |
76 | - | |
77 | - <li>グローバル変数を$mbemu_internalsに集約しました</li> | |
78 | - | |
79 | - <li>エンコーディングにSHIFT_JIS,ISO-8859-1を追加しました</li> | |
80 | - | |
81 | - <li>変換テーブルを必要時に読み込むように修正しました</li> | |
82 | - <li> | |
83 | - mb_convert_kanaのエンコーディングが指定されていないとき,internal_encodingの値を使うように修正しました</li> | |
84 | - | |
85 | -</ul> | |
86 | - | |
87 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.37</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2005/1/30</span></font>)</h3> | |
88 | - | |
89 | -<ul> | |
90 | - | |
91 | - <li> | |
92 | - <p><font face="Times New Roman, serif"><span lang="en-US">JIS</span></font>のマッチングのバグを再び修正しました。 | |
93 | - </p> | |
94 | - | |
95 | - </li> | |
96 | - | |
97 | -</ul> | |
98 | - | |
99 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.36</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2004/11/13</span></font>)</h3> | |
100 | - | |
101 | -<ul> | |
102 | - | |
103 | - <li> | |
104 | - <p><font face="Times New Roman, serif"><span lang="en-US">JIS</span></font>のマッチングのバグを修正しました。 </p> | |
105 | - | |
106 | - </li> | |
107 | - | |
108 | -</ul> | |
109 | - | |
110 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.35</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2004/9/26</span></font>)</h3> | |
111 | - | |
112 | -<ul> | |
113 | - | |
114 | - <li> | |
115 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_send_mail</span></font>のバグを修正しまし | |
116 | -た。 </p> | |
117 | - | |
118 | - </li> | |
119 | - | |
120 | -</ul> | |
121 | - | |
122 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.341</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2004/9/16</span></font>)</h3> | |
123 | - | |
124 | -<ul> | |
125 | - | |
126 | - <li> | |
127 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_kana</span></font>のバグを修正し | |
128 | -ました。 </p> | |
129 | - | |
130 | - </li> | |
131 | - | |
132 | -</ul> | |
133 | - | |
134 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.34</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2004/9/15</span></font>)</h3> | |
135 | - | |
136 | -<ul> | |
137 | - | |
138 | - <li> | |
139 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_kana</span></font>のバグを修正し | |
140 | -ました。 </p> | |
141 | - | |
142 | - </li> | |
143 | - | |
144 | -</ul> | |
145 | - | |
146 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.33</span></font>(<font face="Times New Roman, serif"><span lang="en-US">2004/8/27</span></font>)</h3> | |
147 | - | |
148 | -<ul> | |
149 | - | |
150 | - <li> | |
151 | - <p style="margin-bottom: 0cm;"><font face="Times New Roman, serif"><span lang="en-US">mb_encode_numericentity, | |
152 | -mb_decode_numericentity</span></font>をサポートしました。 </p> | |
153 | - | |
154 | - </li> | |
155 | - | |
156 | - <li> | |
157 | - <p style="margin-bottom: 0cm;"><font face="Times New Roman, serif"><span lang="en-US">mb_convert_encoding</span></font>で<font face="Times New Roman, serif"><span lang="en-US">UTF-16</span></font>か | |
158 | -らの変換をサポートしました。 </p> | |
159 | - | |
160 | - </li> | |
161 | - | |
162 | - <li> | |
163 | - <p style="margin-bottom: 0cm;">シフト<font face="Times New Roman, serif"><span lang="en-US">JIS</span></font>の | |
164 | -処理を<font face="Times New Roman, serif"><span lang="en-US">SJIS-WIN</span></font>互換にしました。<font face="Times New Roman, serif"><span lang="en-US"><br> | |
165 | - | |
166 | -mbstring</span></font>本家とは異なり,<font face="Times New Roman, serif"><span lang="en-US">SJIS</span></font>と<font face="Times New Roman, serif"><span lang="en-US">SJIS-WIN</span></font>の | |
167 | -動作は同じです。 </p> | |
168 | - | |
169 | - </li> | |
170 | - | |
171 | - <li> | |
172 | - <p style="margin-bottom: 0cm;"><font face="Times New Roman, serif"><span lang="en-US">mb_strcut</span></font>の | |
173 | -バグを修正しました。 </p> | |
174 | - | |
175 | - </li> | |
176 | - | |
177 | - <li> | |
178 | - <p>変更履歴を<font face="Times New Roman, serif"><span lang="en-US">HTML</span></font>に変えました。 </p> | |
179 | - | |
180 | - </li> | |
181 | - | |
182 | -</ul> | |
183 | - | |
184 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.32(2004/8/19)</span></font></h3> | |
185 | - | |
186 | -<ul> | |
187 | - | |
188 | - <li> | |
189 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_http_input, mb_http_output, | |
190 | -mb_output_handler </span></font>をサポートしました<font face="Times New Roman, serif"><span lang="en-US"><br> | |
191 | - | |
192 | - </span></font>ただし,<font face="Times New Roman, serif"><span lang="en-US">mb_http_input</span></font>に関しては文字コー | |
193 | -ド変換を行わないため,常に<font face="Times New Roman, serif"><span lang="en-US">FALSE</span></font>を返します。 </p> | |
194 | - | |
195 | - </li> | |
196 | - | |
197 | -</ul> | |
198 | - | |
199 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.31(2004/8/16)</span></font></h3> | |
200 | - | |
201 | -<ul> | |
202 | - | |
203 | - <li> | |
204 | - <p style="margin-bottom: 0cm;"><font face="Times New Roman, serif"><span lang="en-US">mb_decode_mimeheader</span></font>の | |
205 | -バグを修正しました </p> | |
206 | - | |
207 | - </li> | |
208 | - | |
209 | - <li> | |
210 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_variables</span></font>の初 | |
211 | -期設定チェックのバグを修正しました </p> | |
212 | - | |
213 | - </li> | |
214 | - | |
215 | -</ul> | |
216 | - | |
217 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.3(2004/8/8)</span></font></h3> | |
218 | - | |
219 | -<ul> | |
220 | - | |
221 | - <li> | |
222 | - <p style="margin-bottom: 0cm;">バグつぶし<font face="Times New Roman, serif"><span lang="en-US"><br> | |
223 | - | |
224 | - </span></font>入れ子のファンクションで二重宣言になってしまう場合があるので外部に出しました。 </p> | |
225 | - | |
226 | - </li> | |
227 | - | |
228 | - <li> | |
229 | - <p style="margin-bottom: 0cm;">バグつぶし<font face="Times New Roman, serif"><span lang="en-US"><br> | |
230 | - | |
231 | -mb_strcut</span></font>のバグを修正しました </p> | |
232 | - | |
233 | - </li> | |
234 | - | |
235 | - <li> | |
236 | - <p style="margin-bottom: 0cm;"><font face="Times New Roman, serif"><span lang="en-US">mb_encode_mimeheader, | |
237 | -mb_decode_mimeheader</span></font>をサポートしました。 </p> | |
238 | - | |
239 | - </li> | |
240 | - | |
241 | - <li> | |
242 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_variables</span></font>で配 | |
243 | -列からの変換をサポートしました。<font face="Times New Roman, serif"><span lang="en-US"><br> | |
244 | - | |
245 | - </span></font>これに伴い<font face="Times New Roman, serif"><span lang="en-US">mb_convert_variables</span></font>を<font face="Times New Roman, serif"><span lang="en-US">2</span></font>パ | |
246 | -ターンにし,初期設定で変更できるようにしました。<font face="Times New Roman, serif"><span lang="en-US"><br> | |
247 | - | |
248 | - </span></font>初期設定ファイルの<font face="Times New Roman, serif"><span lang="en-US">convert-variables-arrayonly</span></font>が<font face="Times New Roman, serif"><span lang="en-US">no</span></font>の | |
249 | -場合(デフォルト),これまでと同じように配列でなくても変換します。また,最初の要素が配列の場合,それだけを変換します。ただし,こちらの場合,呼び | |
250 | -出し時に引数に<font face="Times New Roman, serif"><span lang="en-US">&</span></font>を付けて明示的に参照渡しに | |
251 | -する必要があります。<font face="Times New Roman, serif"><span lang="en-US"><br> | |
252 | - | |
253 | -convert-variables-arrayonly</span></font>が<font face="Times New Roman, serif"><span lang="en-US">no</span></font>で | |
254 | -ない場合,変換する引数は配列だけになります。その代わり,<font face="Times New Roman, serif"><span lang="en-US">&</span></font>は不要です。 </p> | |
255 | - | |
256 | - </li> | |
257 | - | |
258 | -</ul> | |
259 | - | |
260 | -<h3><font face="Times New Roman, serif"><span lang="en-US">Ver.0.25(2004/7/7)</span></font></h3> | |
261 | - | |
262 | -<ul> | |
263 | - | |
264 | - <li> | |
265 | - <p>バグつぶし<font face="Times New Roman, serif"><span lang="en-US"><br> | |
266 | - | |
267 | - </span></font>入れ子のファンクションで二重宣言になってしまう場合があるので外部に出しました。 </p> | |
268 | - | |
269 | - </li> | |
270 | - | |
271 | -</ul> | |
272 | - | |
273 | -<h3><font face="Times New Roman, serif"><span lang="en-US">ver.0.24(2004/6/8)</span></font></h3> | |
274 | - | |
275 | -<ul> | |
276 | - | |
277 | - <li> | |
278 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strpos, mb_substr_count, | |
279 | -mb_preferred_mime_name</span></font>をサポートしました。 </p> | |
280 | - | |
281 | - </li> | |
282 | - | |
283 | -</ul> | |
284 | - | |
285 | -<h3><font face="Times New Roman, serif"><span lang="en-US">ver.0.23(2004/5/19)</span></font></h3> | |
286 | - | |
287 | -<ul> | |
288 | - | |
289 | - <li> | |
290 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_encoding</span></font>で<font face="Times New Roman, serif"><span lang="en-US">UTF-16</span></font>へ | |
291 | -の変換をサポートしました。<font face="Times New Roman, serif"><span lang="en-US"><br> | |
292 | - | |
293 | - <br> | |
294 | - | |
295 | -usage:<br> | |
296 | - | |
297 | -$str = mb_convert_encoding($str, 'UTF-16', 'EUC-JP, UTF-8');<br> | |
298 | - | |
299 | - <br> | |
300 | - | |
301 | - </span></font>返すのは<font face="Times New Roman, serif"><span lang="en-US">BOM</span></font>なしのビッグ・エンディアンになります。 | |
302 | - </p> | |
303 | - | |
304 | - </li> | |
305 | - | |
306 | -</ul> | |
307 | - | |
308 | -<h3><font face="Times New Roman, serif"><span lang="en-US">ver.0.22(2004/5/11)</span></font></h3> | |
309 | - | |
310 | -<ul> | |
311 | - | |
312 | - <li> | |
313 | - <p style="margin-bottom: 0cm;">バグつぶし </p> | |
314 | - | |
315 | - </li> | |
316 | - | |
317 | - <li> | |
318 | - <p style="margin-bottom: 0cm;"><font face="Times New Roman, serif"><span lang="en-US">mb_convert_variables</span></font>を | |
319 | -暫定サポート </p> | |
320 | - | |
321 | - </li> | |
322 | - | |
323 | - <li> | |
324 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strwidth</span></font>をサポート </p> | |
325 | - | |
326 | - </li> | |
327 | - | |
328 | -</ul> | |
329 | - | |
330 | -<h3><font face="Times New Roman, serif"><span lang="en-US">ver.0.21(2004/4/28)</span></font></h3> | |
331 | - | |
332 | -<ul> | |
333 | - | |
334 | - <li> | |
335 | - <p style="margin-bottom: 0cm;">初期設定を<font face="Times New Roman, serif"><span lang="en-US">mb-emulator.ini</span></font>か | |
336 | -ら読むように変更 </p> | |
337 | - | |
338 | - </li> | |
339 | - | |
340 | - <li> | |
341 | - <p style="margin-bottom: 0cm;"><font face="Times New Roman, serif"><span lang="en-US">EUC</span></font>と<font face="Times New Roman, serif"><span lang="en-US">UTF-8</span></font>間 | |
342 | -を直接変換するように変更 </p> | |
343 | - | |
344 | - </li> | |
345 | - | |
346 | - <li> | |
347 | - <p>バグつぶし </p> | |
348 | - | |
349 | - </li> | |
350 | - | |
351 | -</ul> | |
352 | - | |
353 | -<h3><font face="Times New Roman, serif"><span lang="en-US">ver.0.2(2004/4/27)</span></font></h3> | |
354 | - | |
355 | -<ul> | |
356 | - | |
357 | - <li> | |
358 | - <p><font face="Times New Roman, serif"><span lang="en-US">jcode</span></font>を使わない形で独立しました。<font face="Times New Roman, serif"><span lang="en-US">12</span></font>関 | |
359 | -数サポート<font face="Times New Roman, serif"><span lang="en-US"><br> | |
360 | - | |
361 | -mb_language, mb_internal_encoding, mb_convert_encoding, | |
362 | -mb_convert_kana, mb_send_mail, mb_strimwidth, mb_detect_encoding, | |
363 | -mb_detect_order, mb_strlen, mb_substr, mb_strcut, mb_strrpos </span></font> | |
364 | - </p> | |
365 | - | |
366 | - </li> | |
367 | - | |
368 | -</ul> | |
369 | - | |
370 | -<h2>関数サポート状況(<font face="Times New Roman, serif"><span lang="en-US">2004/8/19</span></font>)</h2> | |
371 | - | |
372 | -<table cellpadding="2" cellspacing="2"> | |
373 | - | |
374 | - <tbody> | |
375 | - | |
376 | - <tr> | |
377 | - | |
378 | - <td width="150"> | |
379 | - <p><font face="Times New Roman, serif"><span lang="en-US"><b>mbstring</b></span></font><b>関 | |
380 | -数名</b></p> | |
381 | - | |
382 | - </td> | |
383 | - | |
384 | - <td width="300"> | |
385 | - <p><b>今後のサポート予定</b></p> | |
386 | - | |
387 | - </td> | |
388 | - | |
389 | - </tr> | |
390 | - | |
391 | - <tr> | |
392 | - | |
393 | - <td> | |
394 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_case</span></font></p> | |
395 | - | |
396 | - </td> | |
397 | - | |
398 | - <td> | |
399 | - <p>サポート可能だけど結構大変そう。あまり使いそうにない気がする。もしニーズがあれば</p> | |
400 | - | |
401 | - </td> | |
402 | - | |
403 | - </tr> | |
404 | - | |
405 | - <tr> | |
406 | - | |
407 | - <td> | |
408 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_encoding</span></font></p> | |
409 | - | |
410 | - </td> | |
411 | - | |
412 | - <td> | |
413 | - <p>サポート済み</p> | |
414 | - | |
415 | - </td> | |
416 | - | |
417 | - </tr> | |
418 | - | |
419 | - <tr> | |
420 | - | |
421 | - <td> | |
422 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_kana</span></font></p> | |
423 | - | |
424 | - </td> | |
425 | - | |
426 | - <td> | |
427 | - <p>サポート済み</p> | |
428 | - | |
429 | - </td> | |
430 | - | |
431 | - </tr> | |
432 | - | |
433 | - <tr> | |
434 | - | |
435 | - <td> | |
436 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_convert_variables</span></font></p> | |
437 | - | |
438 | - </td> | |
439 | - | |
440 | - <td> | |
441 | - <p>サポート済み</p> | |
442 | - | |
443 | - </td> | |
444 | - | |
445 | - </tr> | |
446 | - | |
447 | - <tr> | |
448 | - | |
449 | - <td> | |
450 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_decode_mimeheader</span></font></p> | |
451 | - | |
452 | - </td> | |
453 | - | |
454 | - <td> | |
455 | - <p>サポート済み</p> | |
456 | - | |
457 | - </td> | |
458 | - | |
459 | - </tr> | |
460 | - | |
461 | - <tr> | |
462 | - | |
463 | - <td> | |
464 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_decode_numericentity</span></font></p> | |
465 | - | |
466 | - </td> | |
467 | - | |
468 | - <td> | |
469 | - <p>サポート済み</p> | |
470 | - | |
471 | - </td> | |
472 | - | |
473 | - </tr> | |
474 | - | |
475 | - <tr> | |
476 | - | |
477 | - <td> | |
478 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_detect_encoding</span></font></p> | |
479 | - | |
480 | - </td> | |
481 | - | |
482 | - <td> | |
483 | - <p>サポート済み</p> | |
484 | - | |
485 | - </td> | |
486 | - | |
487 | - </tr> | |
488 | - | |
489 | - <tr> | |
490 | - | |
491 | - <td> | |
492 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_detect_order</span></font></p> | |
493 | - | |
494 | - </td> | |
495 | - | |
496 | - <td> | |
497 | - <p>サポート済み</p> | |
498 | - | |
499 | - </td> | |
500 | - | |
501 | - </tr> | |
502 | - | |
503 | - <tr> | |
504 | - | |
505 | - <td> | |
506 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_encode_mimeheader</span></font></p> | |
507 | - | |
508 | - </td> | |
509 | - | |
510 | - <td> | |
511 | - <p>サポート済み</p> | |
512 | - | |
513 | - </td> | |
514 | - | |
515 | - </tr> | |
516 | - | |
517 | - <tr> | |
518 | - | |
519 | - <td> | |
520 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_encode_numericentity</span></font></p> | |
521 | - | |
522 | - </td> | |
523 | - | |
524 | - <td> | |
525 | - <p>サポート済み</p> | |
526 | - | |
527 | - </td> | |
528 | - | |
529 | - </tr> | |
530 | - | |
531 | - <tr> | |
532 | - | |
533 | - <td> | |
534 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_match</span></font></p> | |
535 | - | |
536 | - </td> | |
537 | - | |
538 | - <td> | |
539 | - <p>サポート不可能</p> | |
540 | - | |
541 | - </td> | |
542 | - | |
543 | - </tr> | |
544 | - | |
545 | - <tr> | |
546 | - | |
547 | - <td> | |
548 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_replace</span></font></p> | |
549 | - | |
550 | - </td> | |
551 | - | |
552 | - <td> | |
553 | - <p>サポート不可能</p> | |
554 | - | |
555 | - </td> | |
556 | - | |
557 | - </tr> | |
558 | - | |
559 | - <tr> | |
560 | - | |
561 | - <td> | |
562 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_search_getpos</span></font></p> | |
563 | - | |
564 | - </td> | |
565 | - | |
566 | - <td> | |
567 | - <p>サポート不可能</p> | |
568 | - | |
569 | - </td> | |
570 | - | |
571 | - </tr> | |
572 | - | |
573 | - <tr> | |
574 | - | |
575 | - <td> | |
576 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_search_getregs</span></font></p> | |
577 | - | |
578 | - </td> | |
579 | - | |
580 | - <td> | |
581 | - <p>サポート不可能</p> | |
582 | - | |
583 | - </td> | |
584 | - | |
585 | - </tr> | |
586 | - | |
587 | - <tr> | |
588 | - | |
589 | - <td> | |
590 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_search_init</span></font></p> | |
591 | - | |
592 | - </td> | |
593 | - | |
594 | - <td> | |
595 | - <p>サポート不可能</p> | |
596 | - | |
597 | - </td> | |
598 | - | |
599 | - </tr> | |
600 | - | |
601 | - <tr> | |
602 | - | |
603 | - <td> | |
604 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_search_pos</span></font></p> | |
605 | - | |
606 | - </td> | |
607 | - | |
608 | - <td> | |
609 | - <p>サポート不可能</p> | |
610 | - | |
611 | - </td> | |
612 | - | |
613 | - </tr> | |
614 | - | |
615 | - <tr> | |
616 | - | |
617 | - <td> | |
618 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_search_regs</span></font></p> | |
619 | - | |
620 | - </td> | |
621 | - | |
622 | - <td> | |
623 | - <p>サポート不可能</p> | |
624 | - | |
625 | - </td> | |
626 | - | |
627 | - </tr> | |
628 | - | |
629 | - <tr> | |
630 | - | |
631 | - <td> | |
632 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_search_setpos</span></font></p> | |
633 | - | |
634 | - </td> | |
635 | - | |
636 | - <td> | |
637 | - <p>サポート不可能</p> | |
638 | - | |
639 | - </td> | |
640 | - | |
641 | - </tr> | |
642 | - | |
643 | - <tr> | |
644 | - | |
645 | - <td> | |
646 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg_search</span></font></p> | |
647 | - | |
648 | - </td> | |
649 | - | |
650 | - <td> | |
651 | - <p>サポート不可能</p> | |
652 | - | |
653 | - </td> | |
654 | - | |
655 | - </tr> | |
656 | - | |
657 | - <tr> | |
658 | - | |
659 | - <td> | |
660 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_ereg</span></font></p> | |
661 | - | |
662 | - </td> | |
663 | - | |
664 | - <td> | |
665 | - <p>サポート不可能</p> | |
666 | - | |
667 | - </td> | |
668 | - | |
669 | - </tr> | |
670 | - | |
671 | - <tr> | |
672 | - | |
673 | - <td> | |
674 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_eregi_replace</span></font></p> | |
675 | - | |
676 | - </td> | |
677 | - | |
678 | - <td> | |
679 | - <p>サポート不可能</p> | |
680 | - | |
681 | - </td> | |
682 | - | |
683 | - </tr> | |
684 | - | |
685 | - <tr> | |
686 | - | |
687 | - <td> | |
688 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_eregi</span></font></p> | |
689 | - | |
690 | - </td> | |
691 | - | |
692 | - <td> | |
693 | - <p>サポート不可能</p> | |
694 | - | |
695 | - </td> | |
696 | - | |
697 | - </tr> | |
698 | - | |
699 | - <tr> | |
700 | - | |
701 | - <td> | |
702 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_get_info</span></font></p> | |
703 | - | |
704 | - </td> | |
705 | - | |
706 | - <td> | |
707 | - <p>サポート可能</p> | |
708 | - | |
709 | - </td> | |
710 | - | |
711 | - </tr> | |
712 | - | |
713 | - <tr> | |
714 | - | |
715 | - <td> | |
716 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_http_input</span></font></p> | |
717 | - | |
718 | - </td> | |
719 | - | |
720 | - <td> | |
721 | - <p>サポート済み(常に<font face="Times New Roman, serif"><span lang="en-US">FALSE</span></font>を返す)</p> | |
722 | - | |
723 | - </td> | |
724 | - | |
725 | - </tr> | |
726 | - | |
727 | - <tr> | |
728 | - | |
729 | - <td> | |
730 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_http_output</span></font></p> | |
731 | - | |
732 | - </td> | |
733 | - | |
734 | - <td> | |
735 | - <p>サポート済み</p> | |
736 | - | |
737 | - </td> | |
738 | - | |
739 | - </tr> | |
740 | - | |
741 | - <tr> | |
742 | - | |
743 | - <td> | |
744 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_internal_encoding</span></font></p> | |
745 | - | |
746 | - </td> | |
747 | - | |
748 | - <td> | |
749 | - <p>サポート済み</p> | |
750 | - | |
751 | - </td> | |
752 | - | |
753 | - </tr> | |
754 | - | |
755 | - <tr> | |
756 | - | |
757 | - <td> | |
758 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_language</span></font></p> | |
759 | - | |
760 | - </td> | |
761 | - | |
762 | - <td> | |
763 | - <p>サポート済み(ただし指定しても何も変わらない)</p> | |
764 | - | |
765 | - </td> | |
766 | - | |
767 | - </tr> | |
768 | - | |
769 | - <tr> | |
770 | - | |
771 | - <td> | |
772 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_output_handler</span></font></p> | |
773 | - | |
774 | - </td> | |
775 | - | |
776 | - <td> | |
777 | - <p>サポート済み</p> | |
778 | - | |
779 | - </td> | |
780 | - | |
781 | - </tr> | |
782 | - | |
783 | - <tr> | |
784 | - | |
785 | - <td> | |
786 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_parse_str</span></font></p> | |
787 | - | |
788 | - </td> | |
789 | - | |
790 | - <td> | |
791 | - <p>サポート可能</p> | |
792 | - | |
793 | - </td> | |
794 | - | |
795 | - </tr> | |
796 | - | |
797 | - <tr> | |
798 | - | |
799 | - <td> | |
800 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_preferred_mime_name</span></font></p> | |
801 | - | |
802 | - </td> | |
803 | - | |
804 | - <td> | |
805 | - <p>サポート済み</p> | |
806 | - | |
807 | - </td> | |
808 | - | |
809 | - </tr> | |
810 | - | |
811 | - <tr> | |
812 | - | |
813 | - <td> | |
814 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_regex_encoding</span></font></p> | |
815 | - | |
816 | - </td> | |
817 | - | |
818 | - <td> | |
819 | - <p>サポート不可能</p> | |
820 | - | |
821 | - </td> | |
822 | - | |
823 | - </tr> | |
824 | - | |
825 | - <tr> | |
826 | - | |
827 | - <td> | |
828 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_regex_set_options</span></font></p> | |
829 | - | |
830 | - </td> | |
831 | - | |
832 | - <td> | |
833 | - <p>サポート不可能</p> | |
834 | - | |
835 | - </td> | |
836 | - | |
837 | - </tr> | |
838 | - | |
839 | - <tr> | |
840 | - | |
841 | - <td> | |
842 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_send_mail</span></font></p> | |
843 | - | |
844 | - </td> | |
845 | - | |
846 | - <td> | |
847 | - <p>サポート済み</p> | |
848 | - | |
849 | - </td> | |
850 | - | |
851 | - </tr> | |
852 | - | |
853 | - <tr> | |
854 | - | |
855 | - <td> | |
856 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_split</span></font></p> | |
857 | - | |
858 | - </td> | |
859 | - | |
860 | - <td> | |
861 | - <p>サポート不可能</p> | |
862 | - | |
863 | - </td> | |
864 | - | |
865 | - </tr> | |
866 | - | |
867 | - <tr> | |
868 | - | |
869 | - <td> | |
870 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strcut</span></font></p> | |
871 | - | |
872 | - </td> | |
873 | - | |
874 | - <td> | |
875 | - <p>サポート済み</p> | |
876 | - | |
877 | - </td> | |
878 | - | |
879 | - </tr> | |
880 | - | |
881 | - <tr> | |
882 | - | |
883 | - <td> | |
884 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strimwidth</span></font></p> | |
885 | - | |
886 | - </td> | |
887 | - | |
888 | - <td> | |
889 | - <p>サポート済み</p> | |
890 | - | |
891 | - </td> | |
892 | - | |
893 | - </tr> | |
894 | - | |
895 | - <tr> | |
896 | - | |
897 | - <td> | |
898 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strlen</span></font></p> | |
899 | - | |
900 | - </td> | |
901 | - | |
902 | - <td> | |
903 | - <p>サポート済み</p> | |
904 | - | |
905 | - </td> | |
906 | - | |
907 | - </tr> | |
908 | - | |
909 | - <tr> | |
910 | - | |
911 | - <td> | |
912 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strpos</span></font></p> | |
913 | - | |
914 | - </td> | |
915 | - | |
916 | - <td> | |
917 | - <p>サポート済み</p> | |
918 | - | |
919 | - </td> | |
920 | - | |
921 | - </tr> | |
922 | - | |
923 | - <tr> | |
924 | - | |
925 | - <td> | |
926 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strrpos</span></font></p> | |
927 | - | |
928 | - </td> | |
929 | - | |
930 | - <td> | |
931 | - <p>サポート済み</p> | |
932 | - | |
933 | - </td> | |
934 | - | |
935 | - </tr> | |
936 | - | |
937 | - <tr> | |
938 | - | |
939 | - <td> | |
940 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strtolower</span></font></p> | |
941 | - | |
942 | - </td> | |
943 | - | |
944 | - <td> | |
945 | - <p>サポート可能だけど大変そう</p> | |
946 | - | |
947 | - </td> | |
948 | - | |
949 | - </tr> | |
950 | - | |
951 | - <tr> | |
952 | - | |
953 | - <td> | |
954 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strtoupper</span></font></p> | |
955 | - | |
956 | - </td> | |
957 | - | |
958 | - <td> | |
959 | - <p>サポート可能だけど大変そう</p> | |
960 | - | |
961 | - </td> | |
962 | - | |
963 | - </tr> | |
964 | - | |
965 | - <tr> | |
966 | - | |
967 | - <td> | |
968 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_strwidth</span></font></p> | |
969 | - | |
970 | - </td> | |
971 | - | |
972 | - <td> | |
973 | - <p>サポート済み</p> | |
974 | - | |
975 | - </td> | |
976 | - | |
977 | - </tr> | |
978 | - | |
979 | - <tr> | |
980 | - | |
981 | - <td> | |
982 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_substitute_character</span></font></p> | |
983 | - | |
984 | - </td> | |
985 | - | |
986 | - <td> | |
987 | - <p>サポート難しそう</p> | |
988 | - | |
989 | - </td> | |
990 | - | |
991 | - </tr> | |
992 | - | |
993 | - <tr> | |
994 | - | |
995 | - <td> | |
996 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_substr_count</span></font></p> | |
997 | - | |
998 | - </td> | |
999 | - | |
1000 | - <td> | |
1001 | - <p>サポート済み</p> | |
1002 | - | |
1003 | - </td> | |
1004 | - | |
1005 | - </tr> | |
1006 | - | |
1007 | - <tr> | |
1008 | - | |
1009 | - <td> | |
1010 | - <p><font face="Times New Roman, serif"><span lang="en-US">mb_substr</span></font></p> | |
1011 | - | |
1012 | - </td> | |
1013 | - | |
1014 | - <td> | |
1015 | - <p>サポート済み</p> | |
1016 | - | |
1017 | - </td> | |
1018 | - | |
1019 | - </tr> | |
1020 | - | |
1021 | - </tbody> | |
1022 | -</table> | |
1023 | - | |
1024 | -<p><br> | |
1025 | - | |
1026 | -<br> | |
1027 | - | |
1028 | -</p> | |
1029 | - | |
1030 | -</body> | |
1031 | -</html> | |
2 | +<HTML> | |
3 | +<HEAD> | |
4 | + <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=shift_jis"> | |
5 | + <TITLE>変更履歴</TITLE> | |
6 | + <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Win32)"> | |
7 | + <META NAME="CREATED" CONTENT="20050130;2310982"> | |
8 | + <META NAME="CHANGED" CONTENT="20050130;2372139"> | |
9 | +</HEAD> | |
10 | +<BODY LANG="ja-JP" DIR="LTR"> | |
11 | +<H2>変更履歴</H2> | |
12 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.37</SPAN></FONT>(<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">2005/1/30</SPAN></FONT>)</H3> | |
13 | +<UL> | |
14 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">JIS</SPAN></FONT>のマッチングのバグを再び修正しました。 | |
15 | + </P> | |
16 | +</UL> | |
17 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.36</SPAN></FONT>(<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">2004/11/13</SPAN></FONT>)</H3> | |
18 | +<UL> | |
19 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">JIS</SPAN></FONT>のマッチングのバグを修正しました。 | |
20 | + </P> | |
21 | +</UL> | |
22 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.35</SPAN></FONT>(<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">2004/9/26</SPAN></FONT>)</H3> | |
23 | +<UL> | |
24 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_send_mail</SPAN></FONT>のバグを修正しました。 | |
25 | + </P> | |
26 | +</UL> | |
27 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.341</SPAN></FONT>(<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">2004/9/16</SPAN></FONT>)</H3> | |
28 | +<UL> | |
29 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_kana</SPAN></FONT>のバグを修正しました。 | |
30 | + </P> | |
31 | +</UL> | |
32 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.34</SPAN></FONT>(<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">2004/9/15</SPAN></FONT>)</H3> | |
33 | +<UL> | |
34 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_kana</SPAN></FONT>のバグを修正しました。 | |
35 | + </P> | |
36 | +</UL> | |
37 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.33</SPAN></FONT>(<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">2004/8/27</SPAN></FONT>)</H3> | |
38 | +<UL> | |
39 | + <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_encode_numericentity, | |
40 | + mb_decode_numericentity</SPAN></FONT>をサポートしました。 | |
41 | + </P> | |
42 | + <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_encoding</SPAN></FONT>で<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">UTF-16</SPAN></FONT>からの変換をサポートしました。 | |
43 | + </P> | |
44 | + <LI><P STYLE="margin-bottom: 0cm">シフト<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">JIS</SPAN></FONT>の処理を<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">SJIS-WIN</SPAN></FONT>互換にしました。<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR>mbstring</SPAN></FONT>本家とは異なり,<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">SJIS</SPAN></FONT>と<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">SJIS-WIN</SPAN></FONT>の動作は同じです。 | |
45 | + </P> | |
46 | + <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strcut</SPAN></FONT>のバグを修正しました。 | |
47 | + </P> | |
48 | + <LI><P>変更履歴を<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">HTML</SPAN></FONT>に変えました。 | |
49 | + </P> | |
50 | +</UL> | |
51 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.32(2004/8/19)</SPAN></FONT></H3> | |
52 | +<UL> | |
53 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_http_input, | |
54 | + mb_http_output, mb_output_handler | |
55 | + </SPAN></FONT>をサポートしました<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR></SPAN></FONT>ただし,<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_http_input</SPAN></FONT>に関しては文字コード変換を行わないため,常に<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">FALSE</SPAN></FONT>を返します。 | |
56 | + </P> | |
57 | +</UL> | |
58 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.31(2004/8/16)</SPAN></FONT></H3> | |
59 | +<UL> | |
60 | + <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_decode_mimeheader</SPAN></FONT>のバグを修正しました | |
61 | + </P> | |
62 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_variables</SPAN></FONT>の初期設定チェックのバグを修正しました | |
63 | + </P> | |
64 | +</UL> | |
65 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.3(2004/8/8)</SPAN></FONT></H3> | |
66 | +<UL> | |
67 | + <LI><P STYLE="margin-bottom: 0cm">バグつぶし<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR></SPAN></FONT>入れ子のファンクションで二重宣言になってしまう場合があるので外部に出しました。 | |
68 | + </P> | |
69 | + <LI><P STYLE="margin-bottom: 0cm">バグつぶし<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR>mb_strcut</SPAN></FONT>のバグを修正しました | |
70 | + </P> | |
71 | + <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_encode_mimeheader, | |
72 | + mb_decode_mimeheader</SPAN></FONT>をサポートしました。 | |
73 | + </P> | |
74 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_variables</SPAN></FONT>で配列からの変換をサポートしました。<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR></SPAN></FONT>これに伴い<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_variables</SPAN></FONT>を<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">2</SPAN></FONT>パターンにし,初期設定で変更できるようにしました。<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR></SPAN></FONT>初期設定ファイルの<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">convert-variables-arrayonly</SPAN></FONT>が<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">no</SPAN></FONT>の場合(デフォルト),これまでと同じように配列でなくても変換します。また,最初の要素が配列の場合,それだけを変換します。ただし,こちらの場合,呼び出し時に引数に<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">&</SPAN></FONT>を付けて明示的に参照渡しにする必要があります。<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR>convert-variables-arrayonly</SPAN></FONT>が<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">no</SPAN></FONT>でない場合,変換する引数は配列だけになります。その代わり,<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">&</SPAN></FONT>は不要です。 | |
75 | + </P> | |
76 | +</UL> | |
77 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">Ver.0.25(2004/7/7)</SPAN></FONT></H3> | |
78 | +<UL> | |
79 | + <LI><P>バグつぶし<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR></SPAN></FONT>入れ子のファンクションで二重宣言になってしまう場合があるので外部に出しました。 | |
80 | + </P> | |
81 | +</UL> | |
82 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">ver.0.24(2004/6/8)</SPAN></FONT></H3> | |
83 | +<UL> | |
84 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strpos, | |
85 | + mb_substr_count, mb_preferred_mime_name</SPAN></FONT>をサポートしました。 | |
86 | + </P> | |
87 | +</UL> | |
88 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">ver.0.23(2004/5/19)</SPAN></FONT></H3> | |
89 | +<UL> | |
90 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_encoding</SPAN></FONT>で<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">UTF-16</SPAN></FONT>への変換をサポートしました。<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR><BR>usage:<BR>$str | |
91 | + = mb_convert_encoding($str, 'UTF-16', 'EUC-JP, | |
92 | + UTF-8');<BR><BR></SPAN></FONT>返すのは<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">BOM</SPAN></FONT>なしのビッグ・エンディアンになります。 | |
93 | + </P> | |
94 | +</UL> | |
95 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">ver.0.22(2004/5/11)</SPAN></FONT></H3> | |
96 | +<UL> | |
97 | + <LI><P STYLE="margin-bottom: 0cm">バグつぶし | |
98 | + </P> | |
99 | + <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_variables</SPAN></FONT>を暫定サポート | |
100 | + </P> | |
101 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strwidth</SPAN></FONT>をサポート | |
102 | + </P> | |
103 | +</UL> | |
104 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">ver.0.21(2004/4/28)</SPAN></FONT></H3> | |
105 | +<UL> | |
106 | + <LI><P STYLE="margin-bottom: 0cm">初期設定を<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb-emulator.ini</SPAN></FONT>から読むように変更 | |
107 | + </P> | |
108 | + <LI><P STYLE="margin-bottom: 0cm"><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">EUC</SPAN></FONT>と<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">UTF-8</SPAN></FONT>間を直接変換するように変更 | |
109 | + </P> | |
110 | + <LI><P>バグつぶし | |
111 | + </P> | |
112 | +</UL> | |
113 | +<H3><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">ver.0.2(2004/4/27)</SPAN></FONT></H3> | |
114 | +<UL> | |
115 | + <LI><P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">jcode</SPAN></FONT>を使わない形で独立しました。<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">12</SPAN></FONT>関数サポート<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><BR>mb_language, | |
116 | + mb_internal_encoding, mb_convert_encoding, mb_convert_kana, | |
117 | + mb_send_mail, mb_strimwidth, mb_detect_encoding, mb_detect_order, | |
118 | + mb_strlen, mb_substr, mb_strcut, mb_strrpos </SPAN></FONT> | |
119 | + </P> | |
120 | +</UL> | |
121 | +<H2>関数サポート状況(<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">2004/8/19</SPAN></FONT>)</H2> | |
122 | +<TABLE CELLPADDING=2 CELLSPACING=2> | |
123 | + <TR> | |
124 | + <TD WIDTH=150> | |
125 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US"><B>mbstring</B></SPAN></FONT><B>関数名</B></P> | |
126 | + </TD> | |
127 | + <TD WIDTH=300> | |
128 | + <P><B>今後のサポート予定</B></P> | |
129 | + </TD> | |
130 | + </TR> | |
131 | + <TR> | |
132 | + <TD> | |
133 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_case</SPAN></FONT></P> | |
134 | + </TD> | |
135 | + <TD> | |
136 | + <P>サポート可能だけど結構大変そう。あまり使いそうにない気がする。もしニーズがあれば</P> | |
137 | + </TD> | |
138 | + </TR> | |
139 | + <TR> | |
140 | + <TD> | |
141 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_encoding</SPAN></FONT></P> | |
142 | + </TD> | |
143 | + <TD> | |
144 | + <P>サポート済み</P> | |
145 | + </TD> | |
146 | + </TR> | |
147 | + <TR> | |
148 | + <TD> | |
149 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_kana</SPAN></FONT></P> | |
150 | + </TD> | |
151 | + <TD> | |
152 | + <P>サポート済み</P> | |
153 | + </TD> | |
154 | + </TR> | |
155 | + <TR> | |
156 | + <TD> | |
157 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_convert_variables</SPAN></FONT></P> | |
158 | + </TD> | |
159 | + <TD> | |
160 | + <P>サポート済み</P> | |
161 | + </TD> | |
162 | + </TR> | |
163 | + <TR> | |
164 | + <TD> | |
165 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_decode_mimeheader</SPAN></FONT></P> | |
166 | + </TD> | |
167 | + <TD> | |
168 | + <P>サポート済み</P> | |
169 | + </TD> | |
170 | + </TR> | |
171 | + <TR> | |
172 | + <TD> | |
173 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_decode_numericentity</SPAN></FONT></P> | |
174 | + </TD> | |
175 | + <TD> | |
176 | + <P>サポート済み</P> | |
177 | + </TD> | |
178 | + </TR> | |
179 | + <TR> | |
180 | + <TD> | |
181 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_detect_encoding</SPAN></FONT></P> | |
182 | + </TD> | |
183 | + <TD> | |
184 | + <P>サポート済み</P> | |
185 | + </TD> | |
186 | + </TR> | |
187 | + <TR> | |
188 | + <TD> | |
189 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_detect_order</SPAN></FONT></P> | |
190 | + </TD> | |
191 | + <TD> | |
192 | + <P>サポート済み</P> | |
193 | + </TD> | |
194 | + </TR> | |
195 | + <TR> | |
196 | + <TD> | |
197 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_encode_mimeheader</SPAN></FONT></P> | |
198 | + </TD> | |
199 | + <TD> | |
200 | + <P>サポート済み</P> | |
201 | + </TD> | |
202 | + </TR> | |
203 | + <TR> | |
204 | + <TD> | |
205 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_encode_numericentity</SPAN></FONT></P> | |
206 | + </TD> | |
207 | + <TD> | |
208 | + <P>サポート済み</P> | |
209 | + </TD> | |
210 | + </TR> | |
211 | + <TR> | |
212 | + <TD> | |
213 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_match</SPAN></FONT></P> | |
214 | + </TD> | |
215 | + <TD> | |
216 | + <P>サポート不可能</P> | |
217 | + </TD> | |
218 | + </TR> | |
219 | + <TR> | |
220 | + <TD> | |
221 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_replace</SPAN></FONT></P> | |
222 | + </TD> | |
223 | + <TD> | |
224 | + <P>サポート不可能</P> | |
225 | + </TD> | |
226 | + </TR> | |
227 | + <TR> | |
228 | + <TD> | |
229 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_search_getpos</SPAN></FONT></P> | |
230 | + </TD> | |
231 | + <TD> | |
232 | + <P>サポート不可能</P> | |
233 | + </TD> | |
234 | + </TR> | |
235 | + <TR> | |
236 | + <TD> | |
237 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_search_getregs</SPAN></FONT></P> | |
238 | + </TD> | |
239 | + <TD> | |
240 | + <P>サポート不可能</P> | |
241 | + </TD> | |
242 | + </TR> | |
243 | + <TR> | |
244 | + <TD> | |
245 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_search_init</SPAN></FONT></P> | |
246 | + </TD> | |
247 | + <TD> | |
248 | + <P>サポート不可能</P> | |
249 | + </TD> | |
250 | + </TR> | |
251 | + <TR> | |
252 | + <TD> | |
253 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_search_pos</SPAN></FONT></P> | |
254 | + </TD> | |
255 | + <TD> | |
256 | + <P>サポート不可能</P> | |
257 | + </TD> | |
258 | + </TR> | |
259 | + <TR> | |
260 | + <TD> | |
261 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_search_regs</SPAN></FONT></P> | |
262 | + </TD> | |
263 | + <TD> | |
264 | + <P>サポート不可能</P> | |
265 | + </TD> | |
266 | + </TR> | |
267 | + <TR> | |
268 | + <TD> | |
269 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_search_setpos</SPAN></FONT></P> | |
270 | + </TD> | |
271 | + <TD> | |
272 | + <P>サポート不可能</P> | |
273 | + </TD> | |
274 | + </TR> | |
275 | + <TR> | |
276 | + <TD> | |
277 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg_search</SPAN></FONT></P> | |
278 | + </TD> | |
279 | + <TD> | |
280 | + <P>サポート不可能</P> | |
281 | + </TD> | |
282 | + </TR> | |
283 | + <TR> | |
284 | + <TD> | |
285 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_ereg</SPAN></FONT></P> | |
286 | + </TD> | |
287 | + <TD> | |
288 | + <P>サポート不可能</P> | |
289 | + </TD> | |
290 | + </TR> | |
291 | + <TR> | |
292 | + <TD> | |
293 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_eregi_replace</SPAN></FONT></P> | |
294 | + </TD> | |
295 | + <TD> | |
296 | + <P>サポート不可能</P> | |
297 | + </TD> | |
298 | + </TR> | |
299 | + <TR> | |
300 | + <TD> | |
301 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_eregi</SPAN></FONT></P> | |
302 | + </TD> | |
303 | + <TD> | |
304 | + <P>サポート不可能</P> | |
305 | + </TD> | |
306 | + </TR> | |
307 | + <TR> | |
308 | + <TD> | |
309 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_get_info</SPAN></FONT></P> | |
310 | + </TD> | |
311 | + <TD> | |
312 | + <P>サポート可能</P> | |
313 | + </TD> | |
314 | + </TR> | |
315 | + <TR> | |
316 | + <TD> | |
317 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_http_input</SPAN></FONT></P> | |
318 | + </TD> | |
319 | + <TD> | |
320 | + <P>サポート済み(常に<FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">FALSE</SPAN></FONT>を返す)</P> | |
321 | + </TD> | |
322 | + </TR> | |
323 | + <TR> | |
324 | + <TD> | |
325 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_http_output</SPAN></FONT></P> | |
326 | + </TD> | |
327 | + <TD> | |
328 | + <P>サポート済み</P> | |
329 | + </TD> | |
330 | + </TR> | |
331 | + <TR> | |
332 | + <TD> | |
333 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_internal_encoding</SPAN></FONT></P> | |
334 | + </TD> | |
335 | + <TD> | |
336 | + <P>サポート済み</P> | |
337 | + </TD> | |
338 | + </TR> | |
339 | + <TR> | |
340 | + <TD> | |
341 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_language</SPAN></FONT></P> | |
342 | + </TD> | |
343 | + <TD> | |
344 | + <P>サポート済み(ただし指定しても何も変わらない)</P> | |
345 | + </TD> | |
346 | + </TR> | |
347 | + <TR> | |
348 | + <TD> | |
349 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_output_handler</SPAN></FONT></P> | |
350 | + </TD> | |
351 | + <TD> | |
352 | + <P>サポート済み</P> | |
353 | + </TD> | |
354 | + </TR> | |
355 | + <TR> | |
356 | + <TD> | |
357 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_parse_str</SPAN></FONT></P> | |
358 | + </TD> | |
359 | + <TD> | |
360 | + <P>サポート可能</P> | |
361 | + </TD> | |
362 | + </TR> | |
363 | + <TR> | |
364 | + <TD> | |
365 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_preferred_mime_name</SPAN></FONT></P> | |
366 | + </TD> | |
367 | + <TD> | |
368 | + <P>サポート済み</P> | |
369 | + </TD> | |
370 | + </TR> | |
371 | + <TR> | |
372 | + <TD> | |
373 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_regex_encoding</SPAN></FONT></P> | |
374 | + </TD> | |
375 | + <TD> | |
376 | + <P>サポート不可能</P> | |
377 | + </TD> | |
378 | + </TR> | |
379 | + <TR> | |
380 | + <TD> | |
381 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_regex_set_options</SPAN></FONT></P> | |
382 | + </TD> | |
383 | + <TD> | |
384 | + <P>サポート不可能</P> | |
385 | + </TD> | |
386 | + </TR> | |
387 | + <TR> | |
388 | + <TD> | |
389 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_send_mail</SPAN></FONT></P> | |
390 | + </TD> | |
391 | + <TD> | |
392 | + <P>サポート済み</P> | |
393 | + </TD> | |
394 | + </TR> | |
395 | + <TR> | |
396 | + <TD> | |
397 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_split</SPAN></FONT></P> | |
398 | + </TD> | |
399 | + <TD> | |
400 | + <P>サポート不可能</P> | |
401 | + </TD> | |
402 | + </TR> | |
403 | + <TR> | |
404 | + <TD> | |
405 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strcut</SPAN></FONT></P> | |
406 | + </TD> | |
407 | + <TD> | |
408 | + <P>サポート済み</P> | |
409 | + </TD> | |
410 | + </TR> | |
411 | + <TR> | |
412 | + <TD> | |
413 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strimwidth</SPAN></FONT></P> | |
414 | + </TD> | |
415 | + <TD> | |
416 | + <P>サポート済み</P> | |
417 | + </TD> | |
418 | + </TR> | |
419 | + <TR> | |
420 | + <TD> | |
421 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strlen</SPAN></FONT></P> | |
422 | + </TD> | |
423 | + <TD> | |
424 | + <P>サポート済み</P> | |
425 | + </TD> | |
426 | + </TR> | |
427 | + <TR> | |
428 | + <TD> | |
429 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strpos</SPAN></FONT></P> | |
430 | + </TD> | |
431 | + <TD> | |
432 | + <P>サポート済み</P> | |
433 | + </TD> | |
434 | + </TR> | |
435 | + <TR> | |
436 | + <TD> | |
437 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strrpos</SPAN></FONT></P> | |
438 | + </TD> | |
439 | + <TD> | |
440 | + <P>サポート済み</P> | |
441 | + </TD> | |
442 | + </TR> | |
443 | + <TR> | |
444 | + <TD> | |
445 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strtolower</SPAN></FONT></P> | |
446 | + </TD> | |
447 | + <TD> | |
448 | + <P>サポート可能だけど大変そう</P> | |
449 | + </TD> | |
450 | + </TR> | |
451 | + <TR> | |
452 | + <TD> | |
453 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strtoupper</SPAN></FONT></P> | |
454 | + </TD> | |
455 | + <TD> | |
456 | + <P>サポート可能だけど大変そう</P> | |
457 | + </TD> | |
458 | + </TR> | |
459 | + <TR> | |
460 | + <TD> | |
461 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_strwidth</SPAN></FONT></P> | |
462 | + </TD> | |
463 | + <TD> | |
464 | + <P>サポート済み</P> | |
465 | + </TD> | |
466 | + </TR> | |
467 | + <TR> | |
468 | + <TD> | |
469 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_substitute_character</SPAN></FONT></P> | |
470 | + </TD> | |
471 | + <TD> | |
472 | + <P>サポート難しそう</P> | |
473 | + </TD> | |
474 | + </TR> | |
475 | + <TR> | |
476 | + <TD> | |
477 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_substr_count</SPAN></FONT></P> | |
478 | + </TD> | |
479 | + <TD> | |
480 | + <P>サポート済み</P> | |
481 | + </TD> | |
482 | + </TR> | |
483 | + <TR> | |
484 | + <TD> | |
485 | + <P><FONT FACE="Times New Roman, serif"><SPAN LANG="en-US">mb_substr</SPAN></FONT></P> | |
486 | + </TD> | |
487 | + <TD> | |
488 | + <P>サポート済み</P> | |
489 | + </TD> | |
490 | + </TR> | |
491 | +</TABLE> | |
492 | +<P><BR><BR> | |
493 | +</P> | |
494 | +</BODY> | |
495 | +</HTML> | |
\ No newline at end of file |
@@ -1,6 +1,5 @@ | ||
1 | 1 | language=ja |
2 | -internal_encoding=UTF-8 | |
2 | +internal_encoding= | |
3 | 3 | detect_order=ASCII, JIS, UTF-8, EUC-JP, SJIS |
4 | 4 | convert_variables_arrayonly=no |
5 | 5 | http_output=pass |
6 | -substitute_character=none |
@@ -1,93 +1,62 @@ | ||
1 | 1 | <?php |
2 | -/* mbstring emulator for Japanese by Andy | |
2 | +/* mb-emulator.php by Andy | |
3 | 3 | * email : webmaster@matsubarafamily.com |
4 | 4 | * |
5 | 5 | * license based on GPL(GNU General Public License) |
6 | 6 | * |
7 | - * Ver.0.84 (2006/1/20) | |
7 | + * Ver.0.37 (2005/1/30) | |
8 | 8 | */ |
9 | 9 | |
10 | 10 | |
11 | -define('MB_CASE_UPPER', 0); | |
12 | -define('MB_CASE_LOWER', 1); | |
13 | -define('MB_CASE_TITLE', 2); | |
14 | 11 | |
15 | 12 | include dirname(__FILE__).'/convert.table'; |
16 | -// include dirname(__FILE__).'/sjistouni.table'; | |
17 | -// include dirname(__FILE__).'/unitosjis.table'; | |
13 | +include dirname(__FILE__).'/sjistouni.table'; | |
14 | +include dirname(__FILE__).'/unitosjis.table'; | |
18 | 15 | |
16 | +$ini_file = parse_ini_file(dirname(__FILE__).'/mb-emulator.ini'); | |
19 | 17 | |
20 | -$mbemu_internals['ini_file'] = parse_ini_file(dirname(__FILE__).'/mb-emulator.ini'); | |
21 | - | |
22 | -$mbemu_internals['language'] = $mbemu_internals['ini_file']['language']; | |
23 | -$mbemu_internals['internal_encoding'] = $mbemu_internals['ini_file']['internal_encoding']; | |
24 | -$mbemu_internals['lang_array'] = array ( | |
25 | - 'Japanese', 'ja','jp', 'English', 'en', 'uni' | |
18 | +$_language = $ini_file['language']; | |
19 | +$_internal_encoding = $ini_file['internal_encoding']; | |
20 | +$_lang_array = array ( | |
21 | + 'Japanese', 'ja', 'English', 'en', 'uni' | |
26 | 22 | ); |
27 | 23 | |
28 | -$mbemu_internals['encoding'] = array ( | |
29 | - 'AUTO' => 0xFF, | |
24 | +$_mb_encoding = array ( | |
25 | + 'AUTO' => 0, | |
30 | 26 | 'ASCII' => 0, |
31 | 27 | 'EUC-JP' => 1, |
32 | 28 | 'EUC' => 1, |
33 | 29 | 'SJIS' => 2, |
34 | 30 | 'SHIFT-JIS' => 2, |
35 | - 'SHIFT_JIS' => 2, | |
36 | 31 | 'SJIS-WIN' => 2, |
37 | 32 | 'JIS' => 3, |
38 | 33 | 'ISO-2022-JP' => 3, |
39 | 34 | 'UTF-8' => 4, |
40 | 35 | 'UTF8' => 4, |
41 | - 'UTF-16'=>5, | |
42 | - 'ISO-8859-1' => 6 | |
36 | + 'UTF-16'=>5 | |
43 | 37 | ); |
44 | 38 | |
39 | +if (!(mb_detect_order($ini_file['detect_order']))) | |
40 | + $_detect_order = array ("ASCII", "JIS", "UTF-8", "EUC-JP", "SJIS"); | |
45 | 41 | |
46 | -function mb_detect_order($encoding_list = '') | |
47 | -{ | |
48 | - global $mbemu_internals; | |
49 | - | |
50 | - if ($encoding_list) { | |
51 | - if (is_string($encoding_list)) { | |
52 | - $encoding_list = strtoupper($encoding_list); | |
53 | - $encoding_list = split(', *', $encoding_list); | |
54 | - } | |
55 | - foreach($encoding_list as $encode) | |
56 | - if (!array_key_exists($encode, $mbemu_internals['encoding'])) return FALSE; | |
57 | - $mbemu_internals['detect_order'] = $encoding_list; | |
58 | - return TRUE; | |
59 | - } | |
60 | - return $mbemu_internals['detect_order']; | |
61 | -} | |
62 | - | |
63 | -if (!(mb_detect_order($mbemu_internals['ini_file']['detect_order']))) | |
64 | - $mbemu_internals['detect_order'] = array ("ASCII", "JIS", "UTF-8", "EUC-JP", "SJIS"); | |
65 | - | |
66 | -$mbemu_internals['substitute_character'] = $mbemu_internals['ini_file']['substitute_character']; | |
67 | - | |
68 | -$mbemu_internals['regex'] = array( | |
69 | - 0 => "[\x01-\x7F]", // for ASCII | |
70 | - 1 => "[\xA1-\xFE]([\xA1-\xFE])|[\x01-\x7F]|\x8E([\xA0-\xDF])", // for EUC-JP | |
71 | - 2 => "[\x81-\x9F\xE0-\xFC]([\x40-\xFC])|[\x01-\x7F]|[\xA0-\xDF]", // for Shift_JIS | |
72 | - 3 => "(?:^|\x1B\(\x42)([\x01-\x1A,\x1C-\x7F]*)|(?:\x1B\\$\x42([\x01-\x1A,\x1C-\x7F]*))|(?:\x1B\(I([\x01-\x1A,\x1C-\x7F]*))", // for JIS | |
73 | - 4 => "[\x01-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF][\x80-\xBF]", // for UTF-8 | |
74 | - 5 => "..", // for UTF-16 | |
75 | - 6 => "." // for ISO-8859-1 | |
76 | - ); | |
77 | 42 | |
78 | 43 | |
44 | +$sjis_match = "[\x81-\x9F,\xE0-\xFC]([\x40-\xFC])|[\x01-\x7F]|[\xA0-\xDF]"; | |
45 | +$euc_match = "[\xa1-\xfe]([\xa1-\xfe])|[\x01-\x7f]|\x8e([\xa0-\xdf])"; | |
46 | +$utf8_match = "[\x01-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF][\x80-\xBF]"; | |
47 | +$jis_match = "(?:^|\x1b\(\x42)([^\x1b]*)|(?:\x1b\\$\x42([^\x1b]*))|(?:\x1b\(I([^\x1b]*))"; | |
79 | 48 | |
80 | -function mb_language($language='') | |
49 | +function mb_language($language) | |
81 | 50 | { |
82 | - global $mbemu_internals; | |
51 | + global $_language, $_lang_array; | |
83 | 52 | |
84 | 53 | if ($language =='') { |
85 | - if ($mbemu_internals['language'] == '') return FALSE; | |
86 | - else return $mbemu_internals['language']; | |
54 | + if ($_language == '') return FALSE; | |
55 | + else return $_language; | |
87 | 56 | } else { |
88 | - foreach ($mbemu_internals['lang_array'] as $element) { | |
57 | + foreach ($_lang_array as $element) { | |
89 | 58 | if ($element == $language) { |
90 | - $mbemu_internals['language'] = $language; | |
59 | + $_language = $language; | |
91 | 60 | return TRUE; |
92 | 61 | } |
93 | 62 | } |
@@ -98,65 +67,29 @@ function mb_language($language='') | ||
98 | 67 | |
99 | 68 | function mb_internal_encoding($encoding = '') |
100 | 69 | { |
101 | - global $mbemu_internals; | |
70 | + global $_internal_encoding; | |
102 | 71 | |
103 | 72 | if ($encoding =='') { |
104 | - if ($mbemu_internals['internal_encoding'] == '') return FALSE; | |
105 | - else return $mbemu_internals['internal_encoding']; | |
73 | + if ($_internal_encoding == '') return FALSE; | |
74 | + else return $_internal_encoding; | |
106 | 75 | } else { |
107 | - $mbemu_internals['internal_encoding'] = $encoding; | |
76 | + $_internal_encoding = $encoding; | |
108 | 77 | return TRUE; |
109 | 78 | } |
110 | 79 | } |
111 | 80 | |
112 | -function mb_get_info($type = 'all') | |
113 | -{ | |
114 | - switch(strtolower($type)) { | |
115 | - case 'all' : | |
116 | - $a['internal_encoding'] = mb_internal_encoding(); | |
117 | - $a['http_output'] = mb_http_output(); | |
118 | - $a['http_input'] = 'pass'; | |
119 | - $a['func_overload'] = 'pass'; | |
120 | - return $a; | |
121 | - case 'internal_encoding' : | |
122 | - return mb_internal_encoding(); | |
123 | - case 'http_output' : | |
124 | - return mb_http_output(); | |
125 | - case 'http_input' : | |
126 | - return 'pass'; | |
127 | - case 'func_overloard' : | |
128 | - return 'pass'; | |
129 | - } | |
130 | -} | |
131 | - | |
132 | -function mb_substitute_character($subchar='') | |
133 | -{ | |
134 | - global $mbemu_internals; | |
135 | - | |
136 | - if (!$subchar) return $mbemu_internals['substitute_character']; | |
137 | - if (is_int($subchar)) { | |
138 | - $mbemu_internals['substitute_character'] = $subchar; | |
139 | - } else { | |
140 | - $subchar = strtolower($subchar); | |
141 | - switch ($subchar) { | |
142 | - case 'none' : | |
143 | - case 'long' : | |
144 | - $mbemu_internals['substitute_character'] = $subchar; | |
145 | - } | |
146 | - } | |
147 | -} | |
148 | 81 | |
149 | 82 | |
150 | 83 | function mb_convert_encoding( $str, $to_encoding, $from_encoding = '') |
151 | 84 | { |
152 | - global $mbemu_internals; | |
85 | + global $_internal_encoding, $_mb_encoding; | |
153 | 86 | |
154 | 87 | $to_encoding = strtoupper($to_encoding); |
155 | 88 | $from_encoding = mb_detect_encoding($str, $from_encoding); |
156 | 89 | |
157 | - switch ($mbemu_internals['encoding'][$from_encoding]) { | |
90 | + switch ($_mb_encoding[$from_encoding]) { | |
158 | 91 | case 1: //euc-jp |
159 | - switch($mbemu_internals['encoding'][$to_encoding]) { | |
92 | + switch($_mb_encoding[$to_encoding]) { | |
160 | 93 | case 2: //sjis |
161 | 94 | return _euctosjis($str); |
162 | 95 | case 3: //jis |
@@ -171,7 +104,7 @@ function mb_convert_encoding( $str, $to_encoding, $from_encoding = '') | ||
171 | 104 | return $str; |
172 | 105 | } |
173 | 106 | case 2: //sjis |
174 | - switch($mbemu_internals['encoding'][$to_encoding]) { | |
107 | + switch($_mb_encoding[$to_encoding]) { | |
175 | 108 | case 1: //euc-jp |
176 | 109 | return _sjistoeuc($str); |
177 | 110 | case 3: //jis |
@@ -185,7 +118,7 @@ function mb_convert_encoding( $str, $to_encoding, $from_encoding = '') | ||
185 | 118 | return $str; |
186 | 119 | } |
187 | 120 | case 3: //jis |
188 | - switch($mbemu_internals['encoding'][$to_encoding]) { | |
121 | + switch($_mb_encoding[$to_encoding]) { | |
189 | 122 | case 1: //euc-jp |
190 | 123 | $str = _jistosjis($str); |
191 | 124 | return _sjistoeuc($str); |
@@ -202,7 +135,7 @@ function mb_convert_encoding( $str, $to_encoding, $from_encoding = '') | ||
202 | 135 | return $str; |
203 | 136 | } |
204 | 137 | case 4: //utf8 |
205 | - switch($mbemu_internals['encoding'][$to_encoding]) { | |
138 | + switch($_mb_encoding[$to_encoding]) { | |
206 | 139 | case 1: //euc-jp |
207 | 140 | return _utf8toeuc($str); |
208 | 141 | case 2: //sjis |
@@ -217,7 +150,7 @@ function mb_convert_encoding( $str, $to_encoding, $from_encoding = '') | ||
217 | 150 | } |
218 | 151 | case 5: //utf16 |
219 | 152 | $str = _utf16toutf8($str); |
220 | - switch($mbemu_internals['encoding'][$to_encoding]) { | |
153 | + switch($_mb_encoding[$to_encoding]) { | |
221 | 154 | case 1: //euc-jp |
222 | 155 | return _utf8toeuc($str); |
223 | 156 | case 2: //sjis |
@@ -235,20 +168,34 @@ function mb_convert_encoding( $str, $to_encoding, $from_encoding = '') | ||
235 | 168 | } |
236 | 169 | } |
237 | 170 | |
171 | +function _get_encoding(&$str, $encoding) | |
172 | +{ | |
173 | + global $_internal_encoding, $_mb_encoding; | |
174 | + | |
175 | + if ($encoding =='') { | |
176 | + if ($_internal_encoding == '') { | |
177 | + return mb_detect_encoding($str, mb_detect_order()); | |
178 | + } else { | |
179 | + return $_internal_encoding; | |
180 | + } | |
181 | + } | |
182 | + return strtoupper($encoding); | |
183 | +} | |
184 | + | |
238 | 185 | |
239 | 186 | |
240 | 187 | function _sjistoeuc(&$str) |
241 | 188 | { |
242 | - global $mbemu_internals; | |
189 | + global $sjis_match, $_sjistoeuc_byte1, $_sjistoeuc_byte2, $_sjistoeuc_byte1_shift; | |
243 | 190 | |
244 | - $max = preg_match_all('/'.$mbemu_internals['regex'][2].'/', $str, $allchars); // 文字の配列に分解 | |
191 | + $max = preg_match_all("/$sjis_match/", $str, $allchars); // 文字の配列に分解 | |
245 | 192 | $str_EUC = ''; |
246 | 193 | for ($i = 0; $i < $max; ++$i) { |
247 | 194 | $num = ord($allchars[0][$i]); // 各文字の1バイト目を数値として取り出す |
248 | 195 | if ($num2 = ord($allchars[1][$i])) { // 2バイト目がある場合 |
249 | - $shift = $mbemu_internals['sjistoeuc_byte1_shift'][$num2]; | |
250 | - $str_EUC .= chr($mbemu_internals['sjistoeuc_byte1'][$num] + $shift) | |
251 | - .chr($mbemu_internals['sjistoeuc_byte2'][$shift][$num2]); | |
196 | + $shift = $_sjistoeuc_byte1_shift[$num2]; | |
197 | + $str_EUC .= chr($_sjistoeuc_byte1[$num] + $shift) | |
198 | + .chr($_sjistoeuc_byte2[$shift][$num2]); | |
252 | 199 | } elseif ($num <= 0x7F) {//英数字 |
253 | 200 | $str_EUC .= chr($num); |
254 | 201 | } else { //半角カナ |
@@ -261,17 +208,17 @@ function _sjistoeuc(&$str) | ||
261 | 208 | |
262 | 209 | function _euctosjis(&$str) |
263 | 210 | { |
264 | - global $mbemu_internals; | |
265 | - $max = preg_match_all('/'.$mbemu_internals['regex'][1].'/', $str, $allchars); // 文字の配列に分解 | |
211 | + global $euc_match, $_euctosjis_byte1, $_euctosjis_byte2; | |
212 | + $max = preg_match_all("/$euc_match/", $str, $allchars); // 文字の配列に分解 | |
266 | 213 | $str_SJIS = ''; |
267 | 214 | for ($i = 0; $i < $max; ++$i) { |
268 | 215 | $num = ord($allchars[0][$i]); // 各文字の1バイト目を数値として取り出す |
269 | 216 | if ($num2 = ord($allchars[1][$i])) { // 漢字の場合 |
270 | - $str_SJIS .= chr($mbemu_internals['euctosjis_byte1'][$num]); | |
217 | + $str_SJIS .= chr($_euctosjis_byte1[$num]); | |
271 | 218 | if ($num & 1) |
272 | - $str_SJIS .= chr($mbemu_internals['euctosjis_byte2'][0][$num2]); | |
219 | + $str_SJIS .= chr($_euctosjis_byte2[0][$num2]); | |
273 | 220 | else |
274 | - $str_SJIS .= chr($mbemu_internals['euctosjis_byte2'][1][$num2]); | |
221 | + $str_SJIS .= chr($_euctosjis_byte2[1][$num2]); | |
275 | 222 | } elseif ($num3 = ord($allchars[2][$i])) {//半角カナ |
276 | 223 | $str_SJIS .= chr($num3); |
277 | 224 | } else { //英数字 |
@@ -283,9 +230,9 @@ function _euctosjis(&$str) | ||
283 | 230 | |
284 | 231 | function _sjistojis(&$str) |
285 | 232 | { |
286 | - global $mbemu_internals; | |
233 | + global $sjis_match, $_sjistoeuc_byte1, $_sjistoeuc_byte2, $_sjistoeuc_byte1_shift; | |
287 | 234 | |
288 | - $max = preg_match_all('/'.$mbemu_internals['regex'][2].'/', $str, $allchars); // 文字の配列に分解 | |
235 | + $max = preg_match_all("/$sjis_match/", $str, $allchars); // 文字の配列に分解 | |
289 | 236 | $str_JIS = ''; |
290 | 237 | $mode = 0; // 英数 |
291 | 238 | for ($i = 0; $i < $max; ++$i) { |
@@ -295,9 +242,9 @@ function _sjistojis(&$str) | ||
295 | 242 | $mode = 1; |
296 | 243 | $str_JIS .= chr(0x1b).'$B'; |
297 | 244 | } |
298 | - $shift = $mbemu_internals['sjistoeuc_byte1_shift'][$num2]; | |
299 | - $str_JIS .= chr(($mbemu_internals['sjistoeuc_byte1'][$num] + $shift) & 0x7F) | |
300 | - .chr($mbemu_internals['sjistoeuc_byte2'][$shift][$num2] & 0x7F); | |
245 | + $shift = $_sjistoeuc_byte1_shift[$num2]; | |
246 | + $str_JIS .= chr(($_sjistoeuc_byte1[$num] + $shift) & 0x7F) | |
247 | + .chr($_sjistoeuc_byte2[$shift][$num2] & 0x7F); | |
301 | 248 | } elseif ($num > 0x80) {//半角カナ |
302 | 249 | if ($mode != 2) { |
303 | 250 | $mode = 2; |
@@ -320,23 +267,23 @@ function _sjistojis(&$str) | ||
320 | 267 | |
321 | 268 | function _sub_jtosj($match) |
322 | 269 | { |
323 | - global $mbemu_internals; | |
270 | + global $_euctosjis_byte1, $_euctosjis_byte2; | |
324 | 271 | $num = ord($match[0]); |
325 | 272 | $num2 = ord($match[1]); |
326 | - $s = chr($mbemu_internals['euctosjis_byte1'][$num | 0x80]); | |
273 | + $s = chr($_euctosjis_byte1[$num | 0x80]); | |
327 | 274 | if ($num & 1) { |
328 | - $s .= chr($mbemu_internals['euctosjis_byte2'][0][$num2 | 0x80]); | |
275 | + $s .= chr($_euctosjis_byte2[0][$num2 | 0x80]); | |
329 | 276 | } else { |
330 | - $s .= chr($mbemu_internals['euctosjis_byte2'][1][$num2 | 0x80]); | |
277 | + $s .= chr($_euctosjis_byte2[1][$num2 | 0x80]); | |
331 | 278 | } |
332 | 279 | return $s; |
333 | 280 | } |
334 | 281 | |
335 | 282 | function _jistosjis(&$str) |
336 | 283 | { |
337 | - global $mbemu_internals; | |
284 | + global $_euctosjis_byte1, $_euctosjis_byte2, $jis_match; | |
338 | 285 | |
339 | - $max = preg_match_all('/'.$mbemu_internals['regex'][3].'/', $str, $allchunks, PREG_SET_ORDER); // 文字種ごとの配列に分解 | |
286 | + $max = preg_match_all("/$jis_match/", $str, $allchunks, PREG_SET_ORDER); // 文字種ごとの配列に分解 | |
340 | 287 | $st = ''; |
341 | 288 | for ($i = 0; $i < $max; ++$i) { |
342 | 289 | if (ord($allchunks[$i][1])) { //英数にマッチ |
@@ -370,14 +317,14 @@ function _ucs2utf8($uni) | ||
370 | 317 | |
371 | 318 | function _sjistoutf8(&$str) |
372 | 319 | { |
373 | - global $mbemu_internals; | |
374 | - include_once(dirname(__FILE__).'/sjistouni.table'); | |
320 | + | |
321 | + global $sjis_match, $sjistoucs2; | |
375 | 322 | $st = ''; |
376 | - $max = preg_match_all('/'.$mbemu_internals['regex'][2].'/', $str, $allchars); // 文字の配列に分解 | |
323 | + $max = preg_match_all("/$sjis_match/", $str, $allchars); // 文字の配列に分解 | |
377 | 324 | for ($i = 0; $i < $max; ++$i) { |
378 | 325 | $num = ord($allchars[0][$i]); // 各文字の1バイト目を数値として取り出す |
379 | 326 | if ($num2 = ord($allchars[1][$i])) { // 2バイト目がある場合 |
380 | - $ucs2 = $mbemu_internals['sjistoucs2'][($num << 8) | $num2]; | |
327 | + $ucs2 = $sjistoucs2[($num << 8) | $num2]; | |
381 | 328 | $st .= _ucs2utf8($ucs2); |
382 | 329 | } elseif ($num > 0x80) {//半角カナ |
383 | 330 | $st .= _ucs2utf8(0xfec0 + $num); |
@@ -405,10 +352,9 @@ function _utf8ucs2($st) | ||
405 | 352 | |
406 | 353 | function _utf8tosjis(&$str) |
407 | 354 | { |
408 | - global $mbemu_internals; | |
409 | - include_once(dirname(__FILE__).'/unitosjis.table'); | |
355 | + global $utf8_match, $ucs2tosjis; | |
410 | 356 | $st = ''; |
411 | - $max = preg_match_all('/'.$mbemu_internals['regex'][4].'/', $str, $allchars); // 文字の配列に分解 | |
357 | + $max = preg_match_all("/$utf8_match/", $str, $allchars); // 文字の配列に分解 | |
412 | 358 | for ($i = 0; $i < $max; ++$i) { |
413 | 359 | $num = _utf8ucs2($allchars[0][$i]); //ucs2の値を取り出す |
414 | 360 | if ($num < 0x80) |
@@ -416,7 +362,7 @@ function _utf8tosjis(&$str) | ||
416 | 362 | elseif ((0xff61 <= $num) && ($num <= 0xff9f)) |
417 | 363 | $st .= chr($num - 0xfec0); |
418 | 364 | else { |
419 | - $sjis = $mbemu_internals['ucs2tosjis'][$num]; | |
365 | + $sjis = $ucs2tosjis[$num]; | |
420 | 366 | $st .= chr($sjis >> 8) . chr($sjis & 0xff); |
421 | 367 | } |
422 | 368 | } |
@@ -425,18 +371,17 @@ function _utf8tosjis(&$str) | ||
425 | 371 | |
426 | 372 | function _euctoutf8(&$str) |
427 | 373 | { |
428 | - global $mbemu_internals; | |
429 | - include_once(dirname(__FILE__).'/sjistouni.table'); | |
374 | + global $euc_match, $sjistoucs2, $_euctosjis_byte1, $_euctosjis_byte2; | |
430 | 375 | $st = ''; |
431 | - $max = preg_match_all('/'.$mbemu_internals['regex'][1].'/', $str, $allchars); // 文字の配列に分解 | |
376 | + $max = preg_match_all("/$euc_match/", $str, $allchars); // 文字の配列に分解 | |
432 | 377 | for ($i = 0; $i < $max; ++$i) { |
433 | 378 | $num = ord($allchars[0][$i]); // 各文字の1バイト目を数値として取り出す |
434 | 379 | if ($num2 = ord($allchars[1][$i])) { // 2バイト目がある場合 |
435 | 380 | if ($num & 1) |
436 | - $sjis = ($mbemu_internals['euctosjis_byte1'][$num] << 8) | $mbemu_internals['euctosjis_byte2'][0][$num2]; | |
381 | + $sjis = ($_euctosjis_byte1[$num] << 8) | $_euctosjis_byte2[0][$num2]; | |
437 | 382 | else |
438 | - $sjis = ($mbemu_internals['euctosjis_byte1'][$num] << 8) | $mbemu_internals['euctosjis_byte2'][1][$num2]; | |
439 | - $st .= _ucs2utf8($mbemu_internals['sjistoucs2'][$sjis]); | |
383 | + $sjis = ($_euctosjis_byte1[$num] << 8) | $_euctosjis_byte2[1][$num2]; | |
384 | + $st .= _ucs2utf8($sjistoucs2[$sjis]); | |
440 | 385 | } elseif ($num3 = ord($allchars[2][$i])) { |
441 | 386 | $st .= _ucs2utf8(0xfec0 + $num3); |
442 | 387 | } else {//半角英数 |
@@ -448,10 +393,9 @@ function _euctoutf8(&$str) | ||
448 | 393 | |
449 | 394 | function _utf8toeuc(&$str) |
450 | 395 | { |
451 | - global $mbemu_internals; | |
452 | - include_once(dirname(__FILE__).'/unitosjis.table'); | |
396 | + global $utf8_match, $ucs2tosjis, $_sjistoeuc_byte1, $_sjistoeuc_byte2, $_sjistoeuc_byte1_shift; | |
453 | 397 | $st = ''; |
454 | - $max = preg_match_all('/'.$mbemu_internals['regex'][4].'/', $str, $allchars); // 文字の配列に分解 | |
398 | + $max = preg_match_all("/$utf8_match/", $str, $allchars); // 文字の配列に分解 | |
455 | 399 | for ($i = 0; $i < $max; ++$i) { |
456 | 400 | $num = _utf8ucs2($allchars[0][$i]); //ucs2の値を取り出す |
457 | 401 | if ($num < 0x80) |
@@ -459,12 +403,12 @@ function _utf8toeuc(&$str) | ||
459 | 403 | elseif ((0xff61 <= $num) && ($num <= 0xff9f)) //半角カナ |
460 | 404 | $st .= chr(0x8e) . chr($num - 0xfec0); |
461 | 405 | else { |
462 | - $sjis = $mbemu_internals['ucs2tosjis'][$num]; | |
406 | + $sjis = $ucs2tosjis[$num]; | |
463 | 407 | $upper = $sjis >> 8; |
464 | 408 | $lower = $sjis & 0xff; |
465 | - $shift = $mbemu_internals['sjistoeuc_byte1_shift'][$lower]; | |
466 | - $st .= chr($mbemu_internals['sjistoeuc_byte1'][$upper] + $shift) | |
467 | - .chr($mbemu_internals['sjistoeuc_byte2'][$shift][$lower]); | |
409 | + $shift = $_sjistoeuc_byte1_shift[$lower]; | |
410 | + $st .= chr($_sjistoeuc_byte1[$upper] + $shift) | |
411 | + .chr($_sjistoeuc_byte2[$shift][$lower]); | |
468 | 412 | } |
469 | 413 | } |
470 | 414 | return $st; |
@@ -472,9 +416,9 @@ function _utf8toeuc(&$str) | ||
472 | 416 | |
473 | 417 | function _utf8toutf16(&$str) |
474 | 418 | { |
475 | - global $mbemu_internals; | |
419 | + global $utf8_match; | |
476 | 420 | $st = ''; |
477 | - $max = preg_match_all('/'.$mbemu_internals['regex'][4].'/', $str, $allchars); // 文字の配列に分解 | |
421 | + $max = preg_match_all("/$utf8_match/", $str, $allchars); // 文字の配列に分解 | |
478 | 422 | for ($i = 0; $i < $max; ++$i) { |
479 | 423 | $num = _utf8ucs2($allchars[0][$i]); //ucs2の値を取り出す |
480 | 424 | $st .= chr(($num >> 8) & 0xff).chr($num & 0xff); |
@@ -484,7 +428,7 @@ function _utf8toutf16(&$str) | ||
484 | 428 | |
485 | 429 | function _utf16toutf8(&$str) |
486 | 430 | { |
487 | - global $mbemu_internals; | |
431 | + global $utf8_match; | |
488 | 432 | $st = ''; |
489 | 433 | $ar = unpack("n*", $str); |
490 | 434 | foreach($ar as $char) { |
@@ -495,14 +439,14 @@ function _utf16toutf8(&$str) | ||
495 | 439 | |
496 | 440 | |
497 | 441 | function sub_zenhan_EUC(&$str, $match) { |
498 | - global $mbemu_internals; | |
442 | + global $alphanumeric_convert; | |
499 | 443 | |
500 | 444 | $match = $match . "|[\xa1-\xfe][\xa1-\xfe]|[\x01-\x7f]|\x8e[\xa0-\xdf]"; |
501 | 445 | $max = preg_match_all("/$match/", $str, $chars); |
502 | 446 | $str = ''; |
503 | 447 | for ($i = 0; $i < $max; ++$i) { |
504 | 448 | if ($num = ord($chars[1][$i])) //全角にマッチングした場合 |
505 | - $str .= chr(array_search($chars[1][$i], $mbemu_internals['alphanumeric_convert'])); | |
449 | + $str .= chr(array_search($chars[1][$i], $alphanumeric_convert)); | |
506 | 450 | // $str .= chr($num & 0x7F); |
507 | 451 | else |
508 | 452 | $str .= $chars[0][$i]; |
@@ -510,14 +454,14 @@ function sub_zenhan_EUC(&$str, $match) { | ||
510 | 454 | } |
511 | 455 | |
512 | 456 | function sub_hanzen_EUC(&$str, $match) { |
513 | - global $mbemu_internals; | |
457 | + global $alphanumeric_convert; | |
514 | 458 | |
515 | 459 | $match = $match . "|[\xa1-\xfe][\xa1-\xfe]|[\x01-\x7f]|\x8e[\xa0-\xdf]"; |
516 | 460 | $max = preg_match_all("/$match/", $str, $chars); |
517 | 461 | $str = ''; |
518 | 462 | for ($i = 0; $i < $max; ++$i) { |
519 | 463 | if ($num = ord($chars[1][$i])) //半角にマッチングした場合 |
520 | - $str .= $mbemu_internals['alphanumeric_convert'][$num]; | |
464 | + $str .= $alphanumeric_convert[$num]; | |
521 | 465 | else |
522 | 466 | $str .= $chars[0][$i]; |
523 | 467 | } |
@@ -558,39 +502,39 @@ function space_hanzen_EUC(&$str) { | ||
558 | 502 | } |
559 | 503 | |
560 | 504 | function katakana_zenhan_EUC(&$str) { |
561 | - global $mbemu_internals; | |
505 | +global $kana_zenhan_convert, $special_zenhan_convert; | |
562 | 506 | |
563 | 507 | $match = "\xa5([\xa1-\xf4])|\xa1([\xa2,\xa3,\xa6,\xab,\xac,\xbc,\xd6,\xd7])|[\xa1-\xfe][\xa1-\xfe]|[\x01-\x7f]|\x8e[\xa0-\xdf]"; |
564 | 508 | $max = preg_match_all("/$match/", $str, $chars); |
565 | 509 | $str = ''; |
566 | 510 | for ($i = 0; $i < $max; ++$i) { |
567 | 511 | if ($num = ord($chars[1][$i])) //カナにマッチングした場合 |
568 | - $str .= chr(0x8e) . $mbemu_internals['kana_zenhan_convert'][$num]; | |
512 | + $str .= chr(0x8e) . $kana_zenhan_convert[$num]; | |
569 | 513 | elseif ($num = ord($chars[2][$i])) //半角変換可能な特殊文字にマッチした場合 |
570 | - $str .= chr(0x8e) . $mbemu_internals['special_zenhan_convert'][$num]; | |
514 | + $str .= chr(0x8e) . $special_zenhan_convert[$num]; | |
571 | 515 | else |
572 | 516 | $str .= $chars[0][$i]; |
573 | 517 | } |
574 | 518 | } |
575 | 519 | |
576 | 520 | function hiragana_zenhan_EUC(&$str) { |
577 | - global $mbemu_internals; | |
521 | +global $kana_zenhan_convert, $special_zenhan_convert; | |
578 | 522 | |
579 | 523 | $match = "\xa4([\xa1-\xf4])|\xa1([\xa2,\xa3,\xa6,\xab,\xac,\xbc,\xd6,\xd7])|[\xa1-\xfe][\xa1-\xfe]|[\x01-\x7f]|\x8e[\xa0-\xdf]"; |
580 | 524 | $max = preg_match_all("/$match/", $str, $chars); |
581 | 525 | $str = ''; |
582 | 526 | for ($i = 0; $i < $max; ++$i) { |
583 | 527 | if ($num = ord($chars[1][$i])) //かなにマッチングした場合 |
584 | - $str .= chr(0x8e) . $mbemu_internals['kana_zenhan_convert'][$num]; | |
528 | + $str .= chr(0x8e) . $kana_zenhan_convert[$num]; | |
585 | 529 | elseif ($num = ord($chars[2][$i])) //半角変換可能な特殊文字にマッチした場合 |
586 | - $str .= chr(0x8e) . $mbemu_internals['special_zenhan_convert'][$num]; | |
530 | + $str .= chr(0x8e) . $special_zenhan_convert[$num]; | |
587 | 531 | else |
588 | 532 | $str .= $chars[0][$i]; |
589 | 533 | } |
590 | 534 | } |
591 | 535 | |
592 | 536 | function katakana_hanzen1_EUC(&$str) { //濁点の統合をする方 |
593 | - global $mbemu_internals; | |
537 | +global $kana_zenhan_convert, $special_zenhan_convert; | |
594 | 538 | |
595 | 539 | $match = "\x8e((?:[\xb3,\xb6-\xc4,\xca-\xce]\x8e\xde)|(?:[\xca-\xce]\x8e\xdf))|[\xa1-\xfe][\xa1-\xfe]|[\x01-\x7f]|\x8e([\xa1-\xdf])"; |
596 | 540 | //濁点や半濁点は一緒にマッチング |
@@ -598,19 +542,19 @@ function katakana_hanzen1_EUC(&$str) { // | ||
598 | 542 | $str = ''; |
599 | 543 | for ($i = 0; $i < $max; ++$i) { |
600 | 544 | if ($chars[1][$i]) //濁音,半濁音にマッチングした場合 |
601 | - $str .= chr(0xa5).chr(array_search($chars[1][$i], $mbemu_internals['kana_zenhan_convert'])); | |
545 | + $str .= chr(0xa5).chr(array_search($chars[1][$i], $kana_zenhan_convert)); | |
602 | 546 | elseif ($chars[2][$i]) //その他の半角カナにマッチ |
603 | - if ($num = array_search($chars[2][$i], $mbemu_internals['kana_zenhan_convert'])) | |
547 | + if ($num = array_search($chars[2][$i], $kana_zenhan_convert)) | |
604 | 548 | $str .= chr(0xa5).chr($num); |
605 | 549 | else |
606 | - $str .= chr(0xa1).chr(array_search($chars[2][$i], $mbemu_internals['special_zenhan_convert'])); | |
550 | + $str .= chr(0xa1).chr(array_search($chars[2][$i], $special_zenhan_convert)); | |
607 | 551 | else |
608 | 552 | $str .= $chars[0][$i]; |
609 | 553 | } |
610 | 554 | } |
611 | 555 | |
612 | 556 | function hiragana_hanzen1_EUC(&$str) { //濁点の統合をする方 |
613 | - global $mbemu_internals; | |
557 | +global $kana_zenhan_convert, $special_zenhan_convert; | |
614 | 558 | |
615 | 559 | $match = "\x8e((?:[\xb6-\xc4,\xca-\xce]\x8e\xde)|(?:[\xca-\xce]\x8e\xdf))|[\xa1-\xfe][\xa1-\xfe]|[\x01-\x7f]|\x8e([\xa1-\xdf])"; |
616 | 560 | //濁点や半濁点は一緒にマッチング |
@@ -618,46 +562,46 @@ function hiragana_hanzen1_EUC(&$str) { // | ||
618 | 562 | $str = ''; |
619 | 563 | for ($i = 0; $i < $max; ++$i) { |
620 | 564 | if ($chars[1][$i]) //濁音,半濁音にマッチングした場合 |
621 | - $str .= chr(0xa4).chr(array_search($chars[1][$i], $mbemu_internals['kana_zenhan_convert'])); | |
565 | + $str .= chr(0xa4).chr(array_search($chars[1][$i], $kana_zenhan_convert)); | |
622 | 566 | elseif ($chars[2][$i]) //その他の半角カナにマッチ |
623 | - if ($num = array_search($chars[2][$i], $mbemu_internals['kana_zenhan_convert'])) | |
567 | + if ($num = array_search($chars[2][$i], $kana_zenhan_convert)) | |
624 | 568 | $str .= chr(0xa4).chr($num); |
625 | 569 | else |
626 | - $str .= chr(0xa1).chr(array_search($chars[2][$i], $mbemu_internals['special_zenhan_convert'])); | |
570 | + $str .= chr(0xa1).chr(array_search($chars[2][$i], $special_zenhan_convert)); | |
627 | 571 | else |
628 | 572 | $str .= $chars[0][$i]; |
629 | 573 | } |
630 | 574 | } |
631 | 575 | |
632 | 576 | function katakana_hanzen2_EUC(&$str) { //濁点の統合をしない方 |
633 | - global $mbemu_internals; | |
577 | +global $kana_zenhan_convert, $special_zenhan_convert; | |
634 | 578 | |
635 | 579 | $match = "[\xa1-\xfe][\xa1-\xfe]|[\x01-\x7f]|\x8e([\xa1-\xdf])"; |
636 | 580 | $max = preg_match_all("/$match/", $str, $chars); |
637 | 581 | $str = ''; |
638 | 582 | for ($i = 0; $i < $max; ++$i) { |
639 | 583 | if ($chars[1][$i]) //半角カナにマッチ |
640 | - if ($num = array_search($chars[1][$i], $mbemu_internals['kana_zenhan_convert'])) | |
584 | + if ($num = array_search($chars[1][$i], $kana_zenhan_convert)) | |
641 | 585 | $str .= chr(0xa5).chr($num); |
642 | 586 | else |
643 | - $str .= chr(0xa1).chr(array_search($chars[1][$i], $mbemu_internals['special_zenhan_convert'])); | |
587 | + $str .= chr(0xa1).chr(array_search($chars[1][$i], $special_zenhan_convert)); | |
644 | 588 | else |
645 | 589 | $str .= $chars[0][$i]; |
646 | 590 | } |
647 | 591 | } |
648 | 592 | |
649 | 593 | function hiragana_hanzen2_EUC(&$str) { //濁点の統合をしない方 |
650 | - global $mbemu_internals; | |
594 | +global $kana_zenhan_convert, $special_zenhan_convert; | |
651 | 595 | |
652 | 596 | $match = "[\xa1-\xfe][\xa1-\xfe]|[\x01-\x7f]|\x8e([\xa1-\xdf])"; |
653 | 597 | $max = preg_match_all("/$match/", $str, $chars); |
654 | 598 | $str = ''; |
655 | 599 | for ($i = 0; $i < $max; ++$i) { |
656 | 600 | if ($chars[1][$i]) //半角カナにマッチ |
657 | - if ($num = array_search($chars[1][$i], $mbemu_internals['kana_zenhan_convert'])) | |
601 | + if ($num = array_search($chars[1][$i], $kana_zenhan_convert)) | |
658 | 602 | $str .= chr(0xa4).chr($num); |
659 | 603 | else |
660 | - $str .= chr(0xa1).chr(array_search($chars[1][$i], $mbemu_internals['special_zenhan_convert'])); | |
604 | + $str .= chr(0xa1).chr(array_search($chars[1][$i], $special_zenhan_convert)); | |
661 | 605 | else |
662 | 606 | $str .= $chars[0][$i]; |
663 | 607 | } |
@@ -691,7 +635,7 @@ function hiragana_katakana_EUC(&$str) { | ||
691 | 635 | |
692 | 636 | function mb_convert_kana( $str, $option='KV', $encoding = '') |
693 | 637 | { |
694 | - if (!$encoding) $encoding = mb_internal_encoding(); | |
638 | + $encoding = mb_detect_encoding($str, $encoding); | |
695 | 639 | $str = mb_convert_encoding($str, 'EUC-JP', $encoding); |
696 | 640 | |
697 | 641 | if (strstr($option, "r")) alpha_zenhan_EUC($str); |
@@ -723,63 +667,76 @@ function mb_convert_kana( $str, $option='KV', $encoding = '') | ||
723 | 667 | return $str; |
724 | 668 | } |
725 | 669 | |
726 | -// if mb_language is uni this function send mail using UTF-8/Base64 | |
727 | -// if English or en this function send mail using ISO-8859-1/quoted printable | |
728 | -// if Japanese this function send mail using ISO-2022-JP | |
729 | -function mb_send_mail($to, $subject, $message , $additional_headers='', $additional_parameter='') | |
670 | +function mb_send_mail($to, $subject, $message , $additional_headers, $additional_parameter) | |
730 | 671 | { |
731 | - switch (mb_language()) { | |
732 | - case 'jp' : | |
733 | - case 'ja' : | |
734 | - case 'Japanese' : | |
735 | - if (!_check_encoding($subject, 3)) //if not JIS encoded | |
736 | - $subject =mb_encode_mimeheader($subject); | |
737 | - else { | |
738 | - $tmp = mb_internal_encoding(); | |
739 | - mb_internal_encoding('iso-2022-jp'); | |
740 | - $subject =mb_encode_mimeheader($subject); | |
741 | - mb_internal_encoding($tmp); | |
742 | - } | |
743 | - if (!_check_encoding($message, 3)) | |
744 | - $message = mb_convert_encoding($message, "iso-2022-jp", mb_internal_encoding()); | |
745 | - $additional_headers .= | |
746 | - "\r\nMime-Version: 1.0\r\nContent-Type: text/plain; charset=ISO-2022-JP\r\nContent-Transfer-Encoding: 7bit"; | |
747 | - mail($to, $subject, $message, $additional_headers, $additional_parameter); | |
748 | - break; | |
749 | - case 'en' : | |
750 | - case 'English' : | |
751 | - $subject =mb_encode_mimeheader($subject, mb_internal_encoding(), 'Q'); | |
752 | - $message = _sub_encode_base64($message, mb_internal_encoding(), 76 , "\r\n"); | |
753 | - $additional_headers .= | |
754 | - "\r\nMime-Version: 1.0\r\nContent-Type: text/plain; charset=". | |
755 | - mb_preferred_mime_name(mb_internal_encoding()). | |
756 | - "\r\nContent-Transfer-Encoding: BASE64"; | |
757 | - mail($to, $subject, $message, $additional_headers, $additional_parameter); | |
758 | - break; | |
759 | - case 'uni' : | |
760 | - $subject =mb_encode_mimeheader($subject, mb_internal_encoding(), 'B'); | |
761 | - $message = _sub_encode_base64($message, mb_internal_encoding(), 76 , "\r\n"); | |
762 | - $additional_headers .= | |
763 | - "\r\nMime-Version: 1.0\r\nContent-Type: text/plain; charset=". | |
764 | - mb_preferred_mime_name(mb_internal_encoding()). | |
765 | - "\r\nContent-Transfer-Encoding: BASE64"; | |
766 | - mail($to, $subject, $message, $additional_headers, $additional_parameter); | |
767 | - break; | |
768 | - } | |
672 | + if (!_is_JIS($subject)) | |
673 | + $subject =mb_encode_mimeheader($subject); | |
674 | + else { | |
675 | + $tmp = mb_internal_encoding(); | |
676 | + mb_internal_encoding('iso-2022-jp'); | |
677 | + $subject =mb_encode_mimeheader($subject); | |
678 | + mb_internal_encoding($tmp); | |
679 | + } | |
680 | + if (!_is_JIS($message)) | |
681 | + $message = mb_convert_encoding($message, "iso-2022-jp", mb_internal_encoding()); | |
682 | + $additional_headers .= | |
683 | + "\r\nMime-Version: 1.0\r\nContent-Type: text/plain; charset=ISO-2022-JP\r\nContent-Transfer-Encoding: 7bit"; | |
684 | + mail($to, $subject, $message, $additional_headers, $additional_parameter); | |
685 | + | |
686 | +} | |
687 | + | |
688 | + | |
689 | +function mb_detect_order($encoding_list = '') | |
690 | +{ | |
691 | + global $_detect_order, $_mb_encoding; | |
769 | 692 | |
693 | + if ($encoding_list) { | |
694 | + if (is_string($encoding_list)) { | |
695 | + $encoding_list = strtoupper($encoding_list); | |
696 | + $encoding_list = split(', *', $encoding_list); | |
697 | + } | |
698 | + foreach($encoding_list as $encode) | |
699 | + if (!array_key_exists($encode, $_mb_encoding)) return FALSE; | |
700 | + $_detect_order = $encoding_list; | |
701 | + return TRUE; | |
702 | + } | |
703 | + return $_detect_order; | |
704 | +} | |
705 | + | |
706 | +function _is_Ascii(&$str) | |
707 | +{ | |
708 | + return (!ereg("[\x80-\xFF]", $str) && !ereg("\x1B", $str)); | |
770 | 709 | } |
771 | 710 | |
711 | +function _is_JIS(&$str) | |
712 | +{ | |
713 | + return (!ereg("[\x80-\xFF]", $str) && ereg("\x1B", $str)); | |
714 | +} | |
772 | 715 | |
716 | +function _is_SJIS(&$str) | |
717 | +{ | |
718 | + $sjis_match = | |
719 | + "[\x01-\x7F]|[\xA0-\xDF]|[\x81-\xFC][\x40-\xFC]"; | |
720 | + return (preg_match("/^($sjis_match)+$/", $str) == 1); | |
721 | +} | |
722 | + | |
723 | +function _is_EUCJP(&$str) | |
724 | +{ | |
725 | + $euc_match = | |
726 | + "[\x01-\x7F]|\x8E[\xA0-\xDF]|\x8F[xA1-\xFE][\xA1-\xFE]|[\xA1-\xFE][\xA1-\xFE]"; | |
727 | + return (preg_match("/^($euc_match)+$/", $str) == 1); | |
728 | +} | |
773 | 729 | |
774 | -function _check_encoding($str, $encoding_number) | |
730 | +function _is_UTF8(&$str) | |
775 | 731 | { |
776 | - global $mbemu_internals; | |
777 | - return (preg_match('/^('.$mbemu_internals['regex'][$encoding_number].')+$/', $str) == 1); | |
732 | + $utf8_match = | |
733 | + "[\x01-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF][\x80-\xBF]"; | |
734 | + return (preg_match("/^($utf8_match)+$/", $str) == 1); | |
778 | 735 | } |
779 | 736 | |
780 | 737 | function mb_detect_encoding( $str , $encoding_list = '') |
781 | 738 | { |
782 | - global $mbemu_internals; | |
739 | + global $_mb_encoding; | |
783 | 740 | |
784 | 741 | if ($encoding_list == '') |
785 | 742 | $encoding_list = mb_detect_order(); |
@@ -792,68 +749,76 @@ function mb_detect_encoding( $str , $encoding_list = '') | ||
792 | 749 | } |
793 | 750 | } |
794 | 751 | foreach($encoding_list as $encode) { |
795 | - if (_check_encoding($str, $mbemu_internals['encoding'][$encode])) | |
796 | - return $encode; | |
752 | + switch ($_mb_encoding[$encode]) { | |
753 | + case 0 : //ascii | |
754 | + if (_is_ASCII($str)) return 'ASCII'; | |
755 | + break; | |
756 | + case 1 : //euc-jp | |
757 | + if (_is_EUCJP($str)) return 'EUC-JP'; | |
758 | + break; | |
759 | + case 2 : //shift-jis | |
760 | + if (_is_SJIS($str)) return 'SJIS'; | |
761 | + break; | |
762 | + case 3 : //jis | |
763 | + if (_is_JIS($str)) return 'JIS'; | |
764 | + break; | |
765 | + case 4 : //utf-8 | |
766 | + if (_is_UTF8($str)) return 'UTF-8'; | |
767 | + break; | |
768 | + } | |
797 | 769 | } |
798 | 770 | return $encode; |
799 | 771 | } |
800 | 772 | |
801 | 773 | function mb_strlen ( $str , $encoding='') |
802 | 774 | { |
803 | - global $mbemu_internals; | |
775 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match; | |
804 | 776 | |
805 | - $encoding = mb_detect_encoding($str, $encoding); | |
777 | + $encoding = _get_encoding($str, $encoding); | |
806 | 778 | |
807 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
779 | + switch ($_mb_encoding[$encoding]) { | |
808 | 780 | case 1 : //euc-jp |
809 | - case 2 : //shift-jis | |
810 | - case 4 : //utf-8 | |
811 | - return preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $str, $arr); | |
812 | - case 5 : //utf-16 | |
813 | - return strlen($str) >> 1; | |
781 | + return preg_match_all("/$euc_match/", $str, $arr); | |
814 | 782 | case 0 : //ascii |
815 | - case 6 : //iso8859-1 | |
816 | - return strlen($str); | |
783 | + case 4 : //utf-8 | |
784 | + return preg_match_all("/$utf8_match/", $str, $arr); | |
785 | + case 2 : //shift-jis | |
786 | + return preg_match_all("/$sjis_match/", $str, $arr); | |
817 | 787 | case 3 : //jis |
818 | 788 | $str = mb_convert_encoding($str, 'SJIS', 'JIS'); |
819 | - return preg_match_all('/'.$mbemu_internals['regex'][2].'/', $str, $arr); | |
789 | + return preg_match_all("/$sjis_match/", $str, $arr); | |
820 | 790 | } |
821 | 791 | } |
822 | 792 | |
823 | 793 | function mb_strwidth( $str, $encoding='') |
824 | 794 | { |
825 | - global $mbemu_internals; | |
795 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match; | |
826 | 796 | |
827 | - $encoding = mb_detect_encoding($str, $encoding); | |
828 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
797 | + $encoding = _get_encoding($str, $encoding); | |
798 | + switch ($_mb_encoding[$encoding]) { | |
799 | + case 1 : //euc-jp | |
800 | + $max = $len = preg_match_all("/$euc_match/", $str, $arr); | |
801 | + $len; | |
802 | + for ($i=0; $i < $max; ++$i) | |
803 | + if ($arr[1][$i]) ++$len; | |
804 | + return $len; | |
805 | + case 0 : //ascii | |
829 | 806 | case 4 : //utf-8 |
830 | - $max = $len = preg_match_all('/'.$mbemu_internals['regex'][4].'/', $str, $arr); | |
807 | + $max = $len = preg_match_all("/$utf8_match/", $str, $arr); | |
831 | 808 | for ($i=0; $i < $max; ++$i) { |
832 | 809 | $ucs2 = _utf8ucs2($arr[0][$i]); |
833 | 810 | if (((0x2000 <= $ucs2) && ($ucs2 <= 0xff60)) || (0xffa0 <= $ucs2)) |
834 | 811 | ++$len; |
835 | 812 | } |
836 | 813 | return $len; |
837 | - case 1 : //euc-jp | |
838 | 814 | case 2 : //shift-jis |
839 | - $max = $len = preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $str, $arr); | |
815 | + $max = $len = preg_match_all("/$sjis_match/", $str, $arr); | |
840 | 816 | for ($i=0; $i < $max; ++$i) |
841 | 817 | if ($arr[1][$i]) ++$len; |
842 | 818 | return $len; |
843 | - case 5 : //utf-16 | |
844 | - $max = $len = preg_match_all('/'.$mbemu_internals['regex'][5].'/', $str, $arr); | |
845 | - for ($i=0; $i < $max; ++$i) { | |
846 | - $ucs2 = (ord($arr[0][$i]) << 8) | ord(substr($arr[0][$i],1,1)); | |
847 | - if (((0x2000 <= $ucs2) && ($ucs2 <= 0xff60)) || (0xffa0 <= $ucs2)) | |
848 | - ++$len; | |
849 | - } | |
850 | - return $len; | |
851 | - case 0 : //ascii | |
852 | - case 6 : //iso8859-1 | |
853 | - return strlen($str); | |
854 | 819 | case 3 : //jis |
855 | 820 | $str = mb_convert_encoding($str, 'SJIS', 'JIS'); |
856 | - $max = $len = preg_match_all('/'.$mbemu_internals['regex'][2].'/', $str, $arr); | |
821 | + $max = $len = preg_match_all("/$sjis_match/", $str, $arr); | |
857 | 822 | for ($i=0; $i < $max; ++$i) |
858 | 823 | if ($arr[1][$i]) ++$len; |
859 | 824 | return $len; |
@@ -862,9 +827,9 @@ function mb_strwidth( $str, $encoding='') | ||
862 | 827 | |
863 | 828 | function mb_strimwidth( $str, $start, $width, $trimmarker , $encoding = '') |
864 | 829 | { |
865 | - global $mbemu_internals; | |
830 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match; | |
866 | 831 | |
867 | - $encoding = mb_detect_encoding($str, $encoding); | |
832 | + $encoding = _get_encoding($str, $encoding); | |
868 | 833 | $str = mb_substr($str, $start, 'notnumber', $encoding); |
869 | 834 | if (($len = mb_strwidth($str,$encoding)) <= $width) |
870 | 835 | return $str; |
@@ -872,16 +837,12 @@ function mb_strimwidth( $str, $start, $width, $trimmarker , $encoding = '') | ||
872 | 837 | $width -= $trimwidth; |
873 | 838 | if ($width <= 0) return $trimmarker; |
874 | 839 | |
875 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
876 | - case 0 : //ascii | |
877 | - case 6 : //iso8859-1 | |
878 | - return substr($str, 0, $width).$trimmarker; | |
879 | - case 4 : //utf-8 | |
880 | - preg_match_all('/'.$mbemu_internals['regex'][4].'/', $str, $arr); | |
840 | + switch ($_mb_encoding[$encoding]) { | |
841 | + case 1 : //euc-jp | |
842 | + preg_match_all("/$euc_match/", $str, $arr); | |
881 | 843 | $i = 0; |
882 | 844 | while(TRUE) { |
883 | - $ucs2 = _utf8ucs2($arr[0][$i]); | |
884 | - if (((0x2000 <= $ucs2) && ($ucs2 <= 0xff60)) || (0xffa0 <= $ucs2)) | |
845 | + if ($arr[1][$i]) | |
885 | 846 | $width -= 2; |
886 | 847 | else |
887 | 848 | --$width; |
@@ -890,10 +851,12 @@ function mb_strimwidth( $str, $start, $width, $trimmarker , $encoding = '') | ||
890 | 851 | } |
891 | 852 | $arr[0] = array_slice($arr[0], 0, $i); |
892 | 853 | return implode("", $arr[0]).$trimmarker; |
893 | - case 5 : //utf-16 | |
894 | - $arr = unpack("n*", $str); | |
854 | + case 0 : //ascii | |
855 | + case 4 : //utf-8 | |
856 | + preg_match_all("/$utf8_match/", $str, $arr); | |
895 | 857 | $i = 0; |
896 | - foreach($arr as $ucs2) { | |
858 | + while(TRUE) { | |
859 | + $ucs2 = _utf8ucs2($arr[0][$i]); | |
897 | 860 | if (((0x2000 <= $ucs2) && ($ucs2 <= 0xff60)) || (0xffa0 <= $ucs2)) |
898 | 861 | $width -= 2; |
899 | 862 | else |
@@ -903,9 +866,8 @@ function mb_strimwidth( $str, $start, $width, $trimmarker , $encoding = '') | ||
903 | 866 | } |
904 | 867 | $arr[0] = array_slice($arr[0], 0, $i); |
905 | 868 | return implode("", $arr[0]).$trimmarker; |
906 | - case 1 : //euc-jp | |
907 | 869 | case 2 : //shift-jis |
908 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $str, $arr); | |
870 | + preg_match_all("/$sjis_match/", $str, $arr); | |
909 | 871 | $i = 0; |
910 | 872 | while(TRUE) { |
911 | 873 | if ($arr[1][$i]) |
@@ -920,7 +882,7 @@ function mb_strimwidth( $str, $start, $width, $trimmarker , $encoding = '') | ||
920 | 882 | case 3 : //jis |
921 | 883 | $str = mb_convert_encoding($str, 'SJIS', 'JIS'); |
922 | 884 | $trimmarker = mb_convert_encoding($trimmarker, 'SJIS', 'JIS'); |
923 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $str, $arr); | |
885 | + preg_match_all("/$sjis_match/", $str, $arr); | |
924 | 886 | $i = 0; |
925 | 887 | while(TRUE) { |
926 | 888 | if ($arr[1][$i]) |
@@ -938,29 +900,31 @@ function mb_strimwidth( $str, $start, $width, $trimmarker , $encoding = '') | ||
938 | 900 | |
939 | 901 | function mb_substr ( $str, $start , $length='notnumber' , $encoding='') |
940 | 902 | { |
941 | - global $mbemu_internals; | |
903 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match; | |
942 | 904 | |
943 | - $encoding = mb_detect_encoding($str, $encoding); | |
905 | + $encoding = _get_encoding($str, $encoding); | |
944 | 906 | |
945 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
946 | - case 0 : //ascii | |
907 | + switch ($_mb_encoding[$encoding]) { | |
947 | 908 | case 1 : //euc-jp |
948 | - case 2 : //shift-jis | |
909 | + preg_match_all("/$euc_match/", $str, $arr); | |
910 | + break; | |
911 | + case 0 : //ascii | |
949 | 912 | case 4 : //utf-8 |
950 | - case 5 : //utf-16 | |
951 | - case 6 : //iso-8859-1 | |
952 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $str, $arr); | |
913 | + preg_match_all("/$utf8_match/", $str, $arr); | |
914 | + break; | |
915 | + case 2 : //shift-jis | |
916 | + preg_match_all("/$sjis_match/", $str, $arr); | |
953 | 917 | break; |
954 | 918 | case 3 : //jis |
955 | 919 | $str = mb_convert_encoding($str, 'SJIS', 'JIS'); |
956 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $str, $arr); | |
920 | + preg_match_all("/$sjis_match/", $str, $arr); | |
957 | 921 | } |
958 | 922 | if (is_int($length)) |
959 | 923 | $arr[0] = array_slice($arr[0], $start, $length); |
960 | 924 | else |
961 | 925 | $arr[0] = array_slice($arr[0], $start); |
962 | 926 | $str = implode("", $arr[0]); |
963 | - if ($mbemu_internals['encoding'][$encoding] == 3) | |
927 | + if ($_mb_encoding[$encoding] == 3) | |
964 | 928 | $str = mb_convert_encoding($str, 'JIS', 'SJIS'); |
965 | 929 | return $str; |
966 | 930 | } |
@@ -990,22 +954,26 @@ function _sub_strcut($arr, $start, $length) { | ||
990 | 954 | |
991 | 955 | function mb_strcut ( $str, $start , $length=0 , $encoding = '') |
992 | 956 | { |
993 | - global $mbemu_internals; | |
957 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match; | |
994 | 958 | |
995 | - $encoding = mb_detect_encoding($str, $encoding); | |
959 | + | |
960 | + $encoding = _get_encoding($str, $encoding); | |
996 | 961 | |
997 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
998 | - case 0 : //ascii | |
962 | + switch ($_mb_encoding[$encoding]) { | |
999 | 963 | case 1 : //euc-jp |
1000 | - case 2 : //shift-jis | |
964 | + preg_match_all("/$euc_match/", $str, $arr); | |
965 | + return _sub_strcut($arr, $start, $length); | |
966 | + case 0 : //ascii | |
967 | + return substr($str, $start, $length); | |
1001 | 968 | case 4 : //utf-8 |
1002 | - case 5 : //utf-16 | |
1003 | - case 6 : //iso-8859-1 | |
1004 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $str, $arr); | |
969 | + preg_match_all("/$utf8_match/", $str, $arr); | |
970 | + return _sub_strcut($arr, $start, $length); | |
971 | + case 2 : //shift-jis | |
972 | + preg_match_all("/$sjis_match/", $str, $arr); | |
1005 | 973 | return _sub_strcut($arr, $start, $length); |
1006 | 974 | case 3 : //jis |
1007 | 975 | $str = mb_convert_encoding($str, 'SJIS', 'JIS'); |
1008 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $str, $arr); | |
976 | + preg_match_all("/$sjis_match/", $str, $arr); | |
1009 | 977 | $sub = _sub_strcut($arr, $start, $length); |
1010 | 978 | return mb_convert_encoding($sub, 'JIS', 'SJIS'); |
1011 | 979 | } |
@@ -1032,25 +1000,29 @@ function _sub_strrpos($ar_haystack, $ar_needle) | ||
1032 | 1000 | function mb_strrpos ( $haystack, $needle , $encoding = '') |
1033 | 1001 | { |
1034 | 1002 | |
1035 | - global $mbemu_internals; | |
1003 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match; | |
1036 | 1004 | |
1037 | - $encoding = mb_detect_encoding($haystack, $encoding); | |
1005 | + $encoding = _get_encoding($haystack, $encoding); | |
1038 | 1006 | |
1039 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
1040 | - case 0 : //ascii | |
1007 | + switch ($_mb_encoding[$encoding]) { | |
1041 | 1008 | case 1 : //euc-jp |
1042 | - case 2 : //shift-jis | |
1009 | + preg_match_all("/$euc_match/", $haystack, $ar_h); | |
1010 | + preg_match_all("/$euc_match/", $needle, $ar_n); | |
1011 | + return _sub_strrpos($ar_h[0], $ar_n[0]); | |
1012 | + case 0 : //ascii | |
1043 | 1013 | case 4 : //utf-8 |
1044 | - case 5 : //utf-16 | |
1045 | - case 6 : //iso-8859-1 | |
1046 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $haystack, $ar_h); | |
1047 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $needle, $ar_n); | |
1014 | + preg_match_all("/$utf8_match/", $haystack, $ar_h); | |
1015 | + preg_match_all("/$utf8_match/", $needle, $ar_n); | |
1016 | + return _sub_strrpos($ar_h[0], $ar_n[0]); | |
1017 | + case 2 : //shift-jis | |
1018 | + preg_match_all("/$sjis_match/", $haystack, $ar_h); | |
1019 | + preg_match_all("/$sjis_match/", $needle, $ar_n); | |
1048 | 1020 | return _sub_strrpos($ar_h[0], $ar_n[0]); |
1049 | 1021 | case 3 : //jis |
1050 | 1022 | $haystack = mb_convert_encoding($haystack, 'SJIS', 'JIS'); |
1051 | 1023 | $needle = mb_convert_encoding($needle, 'SJIS', 'JIS'); |
1052 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $haystack, $ar_h); | |
1053 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $needle, $ar_n); | |
1024 | + preg_match_all("/$sjis_match/", $haystack, $ar_h); | |
1025 | + preg_match_all("/$sjis_match/", $needle, $ar_n); | |
1054 | 1026 | return _sub_strrpos($ar_h[0], $ar_n[0]); |
1055 | 1027 | } |
1056 | 1028 | } |
@@ -1075,25 +1047,29 @@ function _sub_strpos($ar_haystack, $ar_needle, $offset) | ||
1075 | 1047 | function mb_strpos ( $haystack, $needle , $offset = 0, $encoding = '') |
1076 | 1048 | { |
1077 | 1049 | |
1078 | - global $mbemu_internals; | |
1050 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match; | |
1079 | 1051 | |
1080 | - $encoding = mb_detect_encoding($haystack, $encoding); | |
1052 | + $encoding = _get_encoding($haystack, $encoding); | |
1081 | 1053 | |
1082 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
1083 | - case 0 : //ascii | |
1054 | + switch ($_mb_encoding[$encoding]) { | |
1084 | 1055 | case 1 : //euc-jp |
1085 | - case 2 : //shift-jis | |
1056 | + preg_match_all("/$euc_match/", $haystack, $ar_h); | |
1057 | + preg_match_all("/$euc_match/", $needle, $ar_n); | |
1058 | + return _sub_strpos($ar_h[0], $ar_n[0], $offset); | |
1059 | + case 0 : //ascii | |
1086 | 1060 | case 4 : //utf-8 |
1087 | - case 5 : //utf-16 | |
1088 | - case 6 : //iso-8859-1 | |
1089 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $haystack, $ar_h); | |
1090 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $needle, $ar_n); | |
1061 | + preg_match_all("/$utf8_match/", $haystack, $ar_h); | |
1062 | + preg_match_all("/$utf8_match/", $needle, $ar_n); | |
1063 | + return _sub_strpos($ar_h[0], $ar_n[0], $offset); | |
1064 | + case 2 : //shift-jis | |
1065 | + preg_match_all("/$sjis_match/", $haystack, $ar_h); | |
1066 | + preg_match_all("/$sjis_match/", $needle, $ar_n); | |
1091 | 1067 | return _sub_strpos($ar_h[0], $ar_n[0], $offset); |
1092 | 1068 | case 3 : //jis |
1093 | 1069 | $haystack = mb_convert_encoding($haystack, 'SJIS', 'JIS'); |
1094 | 1070 | $needle = mb_convert_encoding($needle, 'SJIS', 'JIS'); |
1095 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $haystack, $ar_h); | |
1096 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $needle, $ar_n); | |
1071 | + preg_match_all("/$sjis_match/", $haystack, $ar_h); | |
1072 | + preg_match_all("/$sjis_match/", $needle, $ar_n); | |
1097 | 1073 | return _sub_strpos($ar_h[0], $ar_n[0], $offset); |
1098 | 1074 | } |
1099 | 1075 | } |
@@ -1119,25 +1095,29 @@ function _sub_substr_count($ar_haystack, $ar_needle) | ||
1119 | 1095 | function mb_substr_count($haystack, $needle , $encoding = '') |
1120 | 1096 | { |
1121 | 1097 | |
1122 | - global $mbemu_internals; | |
1098 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match; | |
1123 | 1099 | |
1124 | - $encoding = mb_detect_encoding($haystack, $encoding); | |
1100 | + $encoding = _get_encoding($haystack, $encoding); | |
1125 | 1101 | |
1126 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
1127 | - case 0 : //ascii | |
1102 | + switch ($_mb_encoding[$encoding]) { | |
1128 | 1103 | case 1 : //euc-jp |
1129 | - case 2 : //shift-jis | |
1104 | + preg_match_all("/$euc_match/", $haystack, $ar_h); | |
1105 | + preg_match_all("/$euc_match/", $needle, $ar_n); | |
1106 | + return _sub_substr_count($ar_h[0], $ar_n[0]); | |
1107 | + case 0 : //ascii | |
1130 | 1108 | case 4 : //utf-8 |
1131 | - case 5 : //utf-16 | |
1132 | - case 6 : //iso-8859-1 | |
1133 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $haystack, $ar_h); | |
1134 | - preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $needle, $ar_n); | |
1109 | + preg_match_all("/$utf8_match/", $haystack, $ar_h); | |
1110 | + preg_match_all("/$utf8_match/", $needle, $ar_n); | |
1111 | + return _sub_substr_count($ar_h[0], $ar_n[0]); | |
1112 | + case 2 : //shift-jis | |
1113 | + preg_match_all("/$sjis_match/", $haystack, $ar_h); | |
1114 | + preg_match_all("/$sjis_match/", $needle, $ar_n); | |
1135 | 1115 | return _sub_substr_count($ar_h[0], $ar_n[0]); |
1136 | 1116 | case 3 : //jis |
1137 | 1117 | $haystack = mb_convert_encoding($haystack, 'SJIS', 'JIS'); |
1138 | 1118 | $needle = mb_convert_encoding($needle, 'SJIS', 'JIS'); |
1139 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $haystack, $ar_h); | |
1140 | - preg_match_all('/'.$mbemu_internals['regex'][2].'/', $needle, $ar_n); | |
1119 | + preg_match_all("/$sjis_match/", $haystack, $ar_h); | |
1120 | + preg_match_all("/$sjis_match/", $needle, $ar_n); | |
1141 | 1121 | return _sub_substr_count($ar_h[0], $ar_n[0]); |
1142 | 1122 | } |
1143 | 1123 | } |
@@ -1146,7 +1126,7 @@ function mb_substr_count($haystack, $needle , $encoding = '') | ||
1146 | 1126 | /****************** |
1147 | 1127 | mb_convert_variables |
1148 | 1128 | *******************/ |
1149 | -if (!$mbemu_internals['ini_file']['convert_variables_arrayonly']) { | |
1129 | +if (!$ini_file['convert_variables_arrayonly']) { | |
1150 | 1130 | function mb_convert_variables($to_encoding, $from_encoding, $s1, $s2='',$s3='',$s4='',$s5='',$s6='',$s7='', $s8='',$s9='', $s10='') |
1151 | 1131 | { |
1152 | 1132 | if (is_array($s1)) { |
@@ -1192,11 +1172,11 @@ if (!$mbemu_internals['ini_file']['convert_variables_arrayonly']) { | ||
1192 | 1172 | |
1193 | 1173 | function mb_preferred_mime_name ($encoding) |
1194 | 1174 | { |
1195 | - global $mbemu_internals; | |
1175 | + global $_mb_encoding; | |
1196 | 1176 | |
1197 | 1177 | $encoding = strtoupper($encoding); |
1198 | 1178 | |
1199 | - switch ($mbemu_internals['encoding'][$encoding]) { | |
1179 | + switch ($_mb_encoding[$encoding]) { | |
1200 | 1180 | case 0 : //ascii |
1201 | 1181 | return 'US-ASCII'; |
1202 | 1182 | case 1 : //euc-jp |
@@ -1207,10 +1187,6 @@ function mb_preferred_mime_name ($encoding) | ||
1207 | 1187 | return 'ISO-2022-JP'; |
1208 | 1188 | case 4 : //utf-8 |
1209 | 1189 | return 'UTF-8'; |
1210 | - case 5 : | |
1211 | - return 'UTF-16'; | |
1212 | - case 6 : | |
1213 | - return 'ISO-8859-1'; | |
1214 | 1190 | } |
1215 | 1191 | } |
1216 | 1192 |
@@ -1258,16 +1234,23 @@ function _sub_qponechar($str, &$len) | ||
1258 | 1234 | |
1259 | 1235 | function _sub_quoted_printable_encode($str, $encoding, $maxline, $linefeed) |
1260 | 1236 | { |
1261 | - global $mbemu_internals; | |
1262 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
1237 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match, $jis_match; | |
1238 | + switch ($_mb_encoding[$encoding]) { | |
1263 | 1239 | case 0 : //ascii |
1240 | + $allchars[0] = unpack("c*", $str); | |
1241 | + $max = count($allchars[0]); | |
1242 | + break; | |
1264 | 1243 | case 1 : //euc-jp |
1244 | + $max = preg_match_all("/$euc_match/", $str, $allchars); | |
1245 | + break; | |
1265 | 1246 | case 2 : //shift-jis |
1247 | + $max = preg_match_all("/$sjis_match/", $str, $allchars); | |
1248 | + break; | |
1266 | 1249 | case 4 : //utf-8 |
1267 | - $max = preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $str, $allchars); | |
1250 | + $max = preg_match_all("/$utf8_match/", $str, $allchars); | |
1268 | 1251 | break; |
1269 | 1252 | case 3 : //jis |
1270 | - $max = preg_match_all('/'.$mbemu_internals['regex'][3].'/', $str, $allchunks, PREG_SET_ORDER); // 文字種ごとの配列に分解 | |
1253 | + $max = preg_match_all("/$jis_match/", $str, $allchunks, PREG_SET_ORDER); // 文字種ごとの配列に分解 | |
1271 | 1254 | $st = ''; // quoted printable変換後の文字列 |
1272 | 1255 | $len = $maxline; // その行に追加可能なバイト数 |
1273 | 1256 | $needterminate = FALSE; //最後にエスケープシーケンスが必要かどうか |
@@ -1354,31 +1337,33 @@ function _sub_quoted_printable_encode($str, $encoding, $maxline, $linefeed) | ||
1354 | 1337 | |
1355 | 1338 | function _sub_encode_base64($str, $encoding, $maxline , $linefeed) |
1356 | 1339 | { |
1357 | - global $mbemu_internals; | |
1358 | - switch ($e = $mbemu_internals['encoding'][$encoding]) { | |
1340 | + global $_mb_encoding, $euc_match, $utf8_match, $sjis_match, $jis_match; | |
1341 | + switch ($_mb_encoding[$encoding]) { | |
1359 | 1342 | case 0 : //ascii |
1360 | - case 6 : //iso-8859-1 | |
1361 | 1343 | return chunk_split( base64_encode($str) , $maxline, $linefeed); |
1362 | 1344 | case 1 : //euc-jp |
1345 | + $max = preg_match_all("/$euc_match/", $str, $allchars); | |
1346 | + break; | |
1363 | 1347 | case 2 : //shift-jis |
1348 | + $max = preg_match_all("/$sjis_match/", $str, $allchars); | |
1349 | + break; | |
1364 | 1350 | case 4 : //utf-8 |
1365 | - case 5 : //utf-16 | |
1366 | - $max = preg_match_all('/'.$mbemu_internals['regex'][$e].'/', $str, $allchars); | |
1351 | + $max = preg_match_all("/$utf8_match/", $str, $allchars); | |
1367 | 1352 | break; |
1368 | 1353 | case 3 : //jis |
1369 | - $max = preg_match_all('/'.$mbemu_internals['regex'][3].'/', $str, $allchunks); // 文字種ごとの配列に分解 | |
1354 | + $max = preg_match_all("/$jis_match/", $str, $allchunks, PREG_SET_ORDER); // 文字種ごとの配列に分解 | |
1370 | 1355 | $st = ''; // BASE64変換後の文字列 |
1371 | 1356 | $maxbytes = floor($maxline * 3 / 4); //1行に変換可能なバイト数 |
1372 | 1357 | $len = $maxbytes; // その行に追加可能なバイト数 |
1373 | 1358 | $line = ''; //1行分の変換前の文字列 |
1374 | 1359 | $needterminate = FALSE; //最後にエスケープシーケンスが必要かどうか |
1375 | 1360 | for ($i = 0; $i < $max; ++$i) { |
1376 | - if (ord($allchunks[1][$i])) { //英数にマッチ | |
1361 | + if (ord($allchunks[$i][1])) { //英数にマッチ | |
1377 | 1362 | if ($needterminate) { |
1378 | 1363 | $line .= chr(0x1B).'(B'; |
1379 | 1364 | $len -= 3; |
1380 | 1365 | } |
1381 | - $tmpstr = $allchunks[1][$i]; //追加する文字列 | |
1366 | + $tmpstr = $allchunks[$i][1]; //追加する文字列 | |
1382 | 1367 | $l = strlen($tmpstr); //追加する文字列の長さ |
1383 | 1368 | while ($l > $len) { |
1384 | 1369 | $line .= substr($tmpstr, 0, $len); |
@@ -1391,8 +1376,8 @@ function _sub_encode_base64($str, $encoding, $maxline , $linefeed) | ||
1391 | 1376 | $line .= $tmpstr; |
1392 | 1377 | $len -= $l; |
1393 | 1378 | $needterminate = FALSE; |
1394 | - } elseif (ord($allchunks[2][$i])) { //漢字にマッチ | |
1395 | - $tmpstr = substr($allchunks[0][$i], 3); | |
1379 | + } elseif (ord($allchunks[$i][2])) { //漢字にマッチ | |
1380 | + $tmpstr = substr($allchunks[$i][0], 3); | |
1396 | 1381 | if ($len < 8) { //文字を追加するのに最低8バイト必要なので |
1397 | 1382 | if ($needterminate) |
1398 | 1383 | $line .= chr(0x1B).'(B'; |
@@ -1417,8 +1402,8 @@ function _sub_encode_base64($str, $encoding, $maxline , $linefeed) | ||
1417 | 1402 | $len -= $l; |
1418 | 1403 | $needterminate = TRUE; |
1419 | 1404 | |
1420 | - } elseif (ord($allchunks[3][$i])) { //半角カナにマッチ | |
1421 | - $tmpstr = $allchunks[3][$i]; | |
1405 | + } elseif (ord($allchunks[$i][3])) { //半角カナにマッチ | |
1406 | + $tmpstr = $allchunks[$i][3]; | |
1422 | 1407 | if ($len < 7) { //文字を追加するのに最低7バイト必要なので |
1423 | 1408 | if ($needterminate) |
1424 | 1409 | $line .= chr(0x1B).'(B'; |
@@ -1466,7 +1451,7 @@ function _sub_encode_base64($str, $encoding, $maxline , $linefeed) | ||
1466 | 1451 | |
1467 | 1452 | function mb_encode_mimeheader( $str, $encoding = "ISO-2022-JP", $transfer_encoding = "B", $linefeed = "\r\n") |
1468 | 1453 | { |
1469 | - global $mbemu_internals; | |
1454 | + global $_mb_encoding; | |
1470 | 1455 | if ($transfer_encoding == "b") $transfer_encoding = "B"; |
1471 | 1456 | if ($transfer_encoding <> "B") $transfer_encoding = "Q"; |
1472 | 1457 | $encoding = strtoupper($encoding); |
@@ -1495,24 +1480,24 @@ function mb_http_input($type = '') | ||
1495 | 1480 | |
1496 | 1481 | function mb_http_output($encoding = '') |
1497 | 1482 | { |
1498 | - global $mbemu_internals; | |
1483 | + global $ini_file; | |
1499 | 1484 | |
1500 | - if ($encoding == '') return $mbemu_internals['ini_file']['http_output']; | |
1485 | + if ($encoding == '') return $ini_file['http_output']; | |
1501 | 1486 | if (strtolower($encoding) == 'pass') { |
1502 | - $mbemu_internals['ini_file']['http_output'] = 'pass'; | |
1487 | + $ini_file['http_output'] = 'pass'; | |
1503 | 1488 | return TRUE; |
1504 | 1489 | } |
1505 | - $mbemu_internals['ini_file']['http_output'] = mb_preferred_mime_name($encoding); | |
1490 | + $ini_file['http_output'] = mb_preferred_mime_name($encoding); | |
1506 | 1491 | return TRUE; |
1507 | 1492 | } |
1508 | 1493 | |
1509 | 1494 | |
1510 | 1495 | function mb_output_handler ( $buffer, $status='') |
1511 | 1496 | { |
1512 | - global $mbemu_internals; | |
1513 | - if ($mbemu_internals['ini_file']['http_output'] == 'pass') | |
1497 | + global $ini_file, $tmpstr; | |
1498 | + if ($ini_file['http_output'] == 'pass') | |
1514 | 1499 | return $buffer; |
1515 | - return mb_convert_encoding($buffer, $mbemu_internals['ini_file']['http_output'], mb_internal_encoding()); | |
1500 | + return mb_convert_encoding($buffer, $ini_file['http_output'], mb_internal_encoding()); | |
1516 | 1501 | } |
1517 | 1502 | |
1518 | 1503 |
@@ -1561,110 +1546,6 @@ function mb_decode_numericentity ($str, $convmap, $encoding="") | ||
1561 | 1546 | return $s; |
1562 | 1547 | } |
1563 | 1548 | |
1564 | -function mb_strtoupper($str, $encoding='') | |
1565 | -{ | |
1566 | - global $mbemu_internals; | |
1567 | - | |
1568 | - include_once(dirname(__FILE__).'/upper.table'); | |
1569 | - $encoding = mb_detect_encoding($str, $encoding); | |
1570 | - $str = mb_convert_encoding($str, 'UTF-8', $encoding); | |
1571 | - | |
1572 | - $max = preg_match_all('/'.$mbemu_internals['regex'][4].'/', $str, $allchars); // make array of chars | |
1573 | - $newst = ''; | |
1574 | - for ($i = 0; $i < $max; ++$i) { | |
1575 | - $val = _utf8ucs2($allchars[0][$i]); //get ucs2 value | |
1576 | - if ((0x61 <= $val) && ($val <= 0x7a)) { | |
1577 | - $val -= 0x20; | |
1578 | - $newst .= _ucs2utf8($val); | |
1579 | - } elseif ($upper = $mbemu_internals['upperarray'][$val]) { | |
1580 | - $newst .= _ucs2utf8($upper); | |
1581 | - } else { | |
1582 | - $newst .= $allchars[0][$i]; | |
1583 | - } | |
1584 | - } | |
1585 | - return mb_convert_encoding($newst, $encoding, 'UTF-8'); | |
1586 | -} | |
1587 | - | |
1588 | -function mb_strtolower($str, $encoding='') | |
1589 | -{ | |
1590 | - global $mbemu_internals; | |
1591 | - | |
1592 | - include_once(dirname(__FILE__).'/lower.table'); | |
1593 | - $encoding = mb_detect_encoding($str, $encoding); | |
1594 | - $str = mb_convert_encoding($str, 'UTF-8', $encoding); | |
1595 | - | |
1596 | - $max = preg_match_all('/'.$mbemu_internals['regex'][4].'/', $str, $allchars); // make array of chars | |
1597 | - $newst = ''; | |
1598 | - for ($i = 0; $i < $max; ++$i) { | |
1599 | - $val = _utf8ucs2($allchars[0][$i]); //get ucs2 value | |
1600 | - if ((0x41 <= $val) && ($val <= 0x5a)) { | |
1601 | - $val += 0x20; | |
1602 | - $newst .= _ucs2utf8($val); | |
1603 | - } elseif ($lower = $mbemu_internals['lowerarray'][$val]) { | |
1604 | - $newst .= _ucs2utf8($lower); | |
1605 | - } else { | |
1606 | - $newst .= $allchars[0][$i]; | |
1607 | - } | |
1608 | - } | |
1609 | - return mb_convert_encoding($newst, $encoding, 'UTF-8'); | |
1610 | -} | |
1611 | - | |
1612 | -function mb_convert_case($str, $case, $encoding='') | |
1613 | -{ | |
1614 | - global $mbemu_internals; | |
1615 | - | |
1616 | - switch($case) { | |
1617 | - case MB_CASE_UPPER : | |
1618 | - return mb_strtoupper($str, $encoding); | |
1619 | - case MB_CASE_LOWER : | |
1620 | - return mb_strtolower($str, $encoding); | |
1621 | - case MB_CASE_TITLE : | |
1622 | - include_once(dirname(__FILE__).'/upper.table'); | |
1623 | - include_once(dirname(__FILE__).'/lower.table'); | |
1624 | - $encoding = mb_detect_encoding($str, $encoding); | |
1625 | - $str = mb_convert_encoding($str, 'UTF-8', $encoding); | |
1626 | - | |
1627 | - $max = preg_match_all('/'.$mbemu_internals['regex'][4].'/', $str, $allchars); // make array of chars | |
1628 | - $newst = ''; | |
1629 | - $isalpha = FALSE; | |
1630 | - for ($i = 0; $i < $max; ++$i) { | |
1631 | - $val = _utf8ucs2($allchars[0][$i]); //get ucs2 value | |
1632 | - if ((0x41 <= $val) && ($val <= 0x5a)) { | |
1633 | - if ($isalpha) { | |
1634 | - $val += 0x20; // to lower; | |
1635 | - } else { | |
1636 | - $isalpha = TRUE; | |
1637 | - } | |
1638 | - $newst .= _ucs2utf8($val); | |
1639 | - } elseif ((0x61 <= $val) && ($val <= 0x7a)){ | |
1640 | - if (!$isalpha) { | |
1641 | - $val -= 0x20; // to upper | |
1642 | - $isalpha = TRUE; | |
1643 | - } | |
1644 | - $newst .= _ucs2utf8($val); | |
1645 | - } elseif ($upper = $mbemu_internals['upperarray'][$val]) { // this char is lower | |
1646 | - if ($isalpha) { | |
1647 | - $newst .= _ucs2utf8($val); | |
1648 | - } else { | |
1649 | - $isalpha = TRUE; | |
1650 | - $newst .= _ucs2utf8($upper); | |
1651 | - } | |
1652 | - } elseif ($lower = $mbemu_internals['lowerarray'][$val]) { // this char is upper | |
1653 | - if ($isalpha) { | |
1654 | - $newst .= _ucs2utf8($lower); | |
1655 | - } else { | |
1656 | - $isalpha = TRUE; | |
1657 | - $newst .= _ucs2utf8($val); | |
1658 | - } | |
1659 | - } else { | |
1660 | - $isalpha = FALSE; | |
1661 | - $newst .= $allchars[0][$i]; | |
1662 | - } | |
1663 | - } | |
1664 | - return mb_convert_encoding($newst, $encoding, 'UTF-8'); | |
1665 | - } | |
1666 | -} | |
1667 | - | |
1668 | 1549 | |
1669 | 1550 | function _print_str($str) { |
1670 | 1551 | $all = unpack("C*", $str); |
@@ -1,5 +1,5 @@ | ||
1 | 1 | <?php |
2 | -$mbemu_internals['sjistoucs2'] = array ( | |
2 | +$sjistoucs2 = array ( | |
3 | 3 | 0x8140=>0x3000, |
4 | 4 | 0x8141=>0x3001, |
5 | 5 | 0x8142=>0x3002, |
@@ -1,5 +1,5 @@ | ||
1 | 1 | <?php |
2 | -$mbemu_internals['ucs2tosjis'] = array( | |
2 | +$ucs2tosjis = array( | |
3 | 3 | 0x3000=>0x8140, |
4 | 4 | 0x3001=>0x8141, |
5 | 5 | 0x3002=>0x8142, |
@@ -1,31 +1,31 @@ | ||
1 | 1 | <?php |
2 | 2 | /* |
3 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | - * Copyright (C) 2002-2007 The Nucleus Group | |
5 | - * | |
6 | - * This program is free software; you can redistribute it and/or | |
7 | - * modify it under the terms of the GNU General Public License | |
8 | - * as published by the Free Software Foundation; either version 2 | |
9 | - * of the License, or (at your option) any later version. | |
10 | - * (see nucleus/documentation/index.html#license for more info) | |
3 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | + * Copyright (C) 2002-2005 The Nucleus Group | |
5 | + * | |
6 | + * This program is free software; you can redistribute it and/or | |
7 | + * modify it under the terms of the GNU General Public License | |
8 | + * as published by the Free Software Foundation; either version 2 | |
9 | + * of the License, or (at your option) any later version. | |
10 | + * (see nucleus/documentation/index.html#license for more info) | |
11 | 11 | */ |
12 | 12 | /** |
13 | - * Media popup window for Nucleus | |
14 | - * | |
15 | - * Purpose: | |
16 | - * - can be openen from an add-item form or bookmarklet popup | |
17 | - * - shows a list of recent files, allowing browsing, search and | |
18 | - * upload of new files | |
19 | - * - close the popup by selecting a file in the list. The file gets | |
20 | - * passed through to the add-item form (linkto, popupimg or inline img) | |
21 | - * | |
13 | + * Media popup window for Nucleus | |
14 | + * | |
15 | + * Purpose: | |
16 | + * - can be openen from an add-item form or bookmarklet popup | |
17 | + * - shows a list of recent files, allowing browsing, search and | |
18 | + * upload of new files | |
19 | + * - close the popup by selecting a file in the list. The file gets | |
20 | + * passed through to the add-item form (linkto, popupimg or inline img) | |
21 | + * | |
22 | 22 | * @license http://nucleuscms.org/license.txt GNU General Public License |
23 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
24 | - * @version $Id: media.php,v 1.3.2.2 2007-03-27 11:26:59 kimitake Exp $ | |
25 | - * $NucleusJP: media.php,v 1.8 2007/03/20 19:32:19 kmorimatsu Exp $ | |
23 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
24 | + * @version $Id: media.php,v 1.3.2.3 2007-03-27 11:46:58 kimitake Exp $ | |
25 | + * @version $NucleusJP: media.php,v 1.3.2.1 2005/08/23 08:08:37 kimitake Exp $ | |
26 | 26 | * |
27 | - */ | |
28 | - | |
27 | + */ | |
28 | + | |
29 | 29 | $CONF = array(); |
30 | 30 | |
31 | 31 | // defines how much media items will be shown per page. You can override this |
@@ -34,7 +34,7 @@ $CONF = array(); | ||
34 | 34 | $CONF['MediaPerPage'] = 10; |
35 | 35 | |
36 | 36 | // include all classes and config data |
37 | -require('../config.php'); | |
37 | +include('../config.php'); | |
38 | 38 | include($DIR_LIBS . 'MEDIA.php'); // media classes |
39 | 39 | |
40 | 40 | sendContentType('application/xhtml+xml', 'media'); |
@@ -50,19 +50,19 @@ $query = 'SELECT * FROM ' . sql_table('team'). ' WHERE tmember=' . $member->getI | ||
50 | 50 | $teams = mysql_query($query); |
51 | 51 | if (mysql_num_rows($teams) == 0) |
52 | 52 | media_doError(_ERROR_DISALLOWEDUPLOAD); |
53 | - | |
53 | + | |
54 | 54 | // get action |
55 | 55 | $action = requestVar('action'); |
56 | 56 | if ($action == '') |
57 | 57 | $action = 'selectmedia'; |
58 | - | |
58 | + | |
59 | 59 | // check ticket |
60 | 60 | $aActionsNotToCheck = array('selectmedia', _MEDIA_FILTER_APPLY, _MEDIA_COLLECTION_SELECT); |
61 | 61 | if (!in_array($action, $aActionsNotToCheck)) |
62 | 62 | { |
63 | 63 | if (!$manager->checkTicket()) |
64 | 64 | media_doError(_ERROR_BADTICKET); |
65 | -} | |
65 | +} | |
66 | 66 | |
67 | 67 | |
68 | 68 | switch($action) { |
@@ -85,10 +85,10 @@ switch($action) { | ||
85 | 85 | // select a file |
86 | 86 | function media_select() { |
87 | 87 | global $member, $CONF, $DIR_MEDIA, $manager; |
88 | - | |
88 | + | |
89 | 89 | media_head(); |
90 | - | |
91 | - // show 10 files + navigation buttons | |
90 | + | |
91 | + // show 10 files + navigation buttons | |
92 | 92 | // show msg when no files |
93 | 93 | // show upload form |
94 | 94 | // files sorted according to last modification date |
@@ -97,8 +97,8 @@ function media_select() { | ||
97 | 97 | $currentCollection = requestVar('collection'); |
98 | 98 | if (!$currentCollection || !@is_dir($DIR_MEDIA . $currentCollection)) |
99 | 99 | $currentCollection = $member->getID(); |
100 | - | |
101 | - | |
100 | + | |
101 | + | |
102 | 102 | // get collection list |
103 | 103 | $collections = MEDIA::getCollectionList(); |
104 | 104 |
@@ -126,11 +126,11 @@ function media_select() { | ||
126 | 126 | <input type="hidden" name="collection" value="<?php echo htmlspecialchars($currentCollection)?>" /> |
127 | 127 | <input type="submit" name="action" value="<?php echo htmlspecialchars(_MEDIA_UPLOAD_NEW) ?>" title="<?php echo htmlspecialchars(_MEDIA_UPLOADLINK) ?>" /> |
128 | 128 | <?php $manager->addTicketHidden() ?> |
129 | - </div></form> | |
129 | + </div></form> | |
130 | 130 | <?php } // if sizeof |
131 | - | |
132 | - $filter = requestVar('filter'); | |
133 | - $offset = intRequestVar('offset'); | |
131 | + | |
132 | + $filter = requestVar('filter'); | |
133 | + $offset = intRequestVar('offset'); | |
134 | 134 | $arr = MEDIA::getMediaListByCollection($currentCollection, $filter); |
135 | 135 | |
136 | 136 | ?> |
@@ -138,28 +138,28 @@ function media_select() { | ||
138 | 138 | <label for="media_filter"><?php echo htmlspecialchars(_MEDIA_FILTER_LABEL)?></label> |
139 | 139 | <input id="media_filter" type="text" name="filter" value="<?php echo htmlspecialchars($filter)?>" /> |
140 | 140 | <input type="submit" name="action" value="<?php echo htmlspecialchars(_MEDIA_FILTER_APPLY) ?>" /> |
141 | - <input type="hidden" name="collection" value="<?php echo htmlspecialchars($currentCollection)?>" /> | |
142 | - <input type="hidden" name="offset" value="<?php echo intval($offset)?>" /> | |
143 | - </div></form> | |
144 | - | |
141 | + <input type="hidden" name="collection" value="<?php echo htmlspecialchars($currentCollection)?>" /> | |
142 | + <input type="hidden" name="offset" value="<?php echo intval($offset)?>" /> | |
143 | + </div></form> | |
144 | + | |
145 | 145 | <?php |
146 | - | |
147 | - ?> | |
146 | + | |
147 | + ?> | |
148 | 148 | <table width="100%"> |
149 | 149 | <caption><?php echo _MEDIA_COLLECTION_LABEL . htmlspecialchars($collections[$currentCollection])?></caption> |
150 | 150 | <tr> |
151 | 151 | <th><?php echo _MEDIA_MODIFIED?></th><th><?php echo _MEDIA_FILENAME?></th><th><?php echo _MEDIA_DIMENSIONS?></th> |
152 | 152 | </tr> |
153 | - | |
154 | - <?php | |
155 | - | |
153 | + | |
154 | + <?php | |
155 | + | |
156 | 156 | if (sizeof($arr)>0) { |
157 | - | |
157 | + | |
158 | 158 | if (($offset + $CONF['MediaPerPage']) >= sizeof($arr)) |
159 | 159 | $offset = sizeof($arr) - $CONF['MediaPerPage']; |
160 | 160 | |
161 | 161 | if ($offset < 0) $offset = 0; |
162 | - | |
162 | + | |
163 | 163 | $idxStart = $offset; |
164 | 164 | $idxEnd = $offset + $CONF['MediaPerPage']; |
165 | 165 | $idxNext = $idxEnd; |
@@ -175,15 +175,15 @@ function media_select() { | ||
175 | 175 | $filename = $DIR_MEDIA . $currentCollection . '/' . $obj->filename; |
176 | 176 | |
177 | 177 | $old_level = error_reporting(0); |
178 | - $size = @GetImageSize($filename); | |
178 | + $size = @GetImageSize($filename); | |
179 | 179 | error_reporting($old_level); |
180 | 180 | $width = $size[0]; |
181 | 181 | $height = $size[1]; |
182 | 182 | $filetype = $size[2]; |
183 | - | |
183 | + | |
184 | 184 | echo "<tr>"; |
185 | 185 | echo "<td>". date("Y-m-d",$obj->timestamp) ."</td>"; |
186 | - | |
186 | + | |
187 | 187 | // strings for javascript |
188 | 188 | $jsCurrentCollection = str_replace("'","\\'",$currentCollection); |
189 | 189 | $jsFileName = str_replace("'","\\'",$obj->filename); |
@@ -210,21 +210,21 @@ function media_select() { | ||
210 | 210 | } |
211 | 211 | } // if (sizeof($arr)>0) |
212 | 212 | ?> |
213 | - | |
213 | + | |
214 | 214 | </table> |
215 | - <?php | |
215 | + <?php | |
216 | 216 | if ($idxStart > 0) |
217 | 217 | echo "<a href='media.php?offset=$idxPrev&collection=".urlencode($currentCollection)."'>". _LISTS_PREV."</a> "; |
218 | 218 | if ($idxEnd < sizeof($arr)) |
219 | 219 | echo "<a href='media.php?offset=$idxNext&collection=".urlencode($currentCollection)."'>". _LISTS_NEXT."</a> "; |
220 | - | |
220 | + | |
221 | 221 | ?> |
222 | 222 | <input id="typeradio0" type="radio" name="typeradio" onclick="setType(0);" checked="checked" /><label for="typeradio0"><?php echo _MEDIA_INLINE?></label> |
223 | 223 | <input id="typeradio1" type="radio" name="typeradio" onclick="setType(1);" /><label for="typeradio1"><?php echo _MEDIA_POPUP?></label> |
224 | - <?php | |
224 | + <?php | |
225 | 225 | media_foot(); |
226 | - | |
227 | - | |
226 | + | |
227 | + | |
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -234,19 +234,19 @@ function media_choose() { | ||
234 | 234 | global $CONF, $member, $manager; |
235 | 235 | |
236 | 236 | $currentCollection = requestVar('collection'); |
237 | - | |
237 | + | |
238 | 238 | $collections = MEDIA::getCollectionList(); |
239 | 239 | |
240 | 240 | media_head(); |
241 | 241 | ?> |
242 | 242 | <h1><?php echo _UPLOAD_TITLE?></h1> |
243 | - | |
243 | + | |
244 | 244 | <p><?php echo _UPLOAD_MSG?></p> |
245 | - | |
245 | + | |
246 | 246 | <form method="post" enctype="multipart/form-data" action="media.php"> |
247 | 247 | <div> |
248 | - <input type="hidden" name="action" value="uploadfile" /> | |
249 | - <?php $manager->addTicketHidden() ?> | |
248 | + <input type="hidden" name="action" value="uploadfile" /> | |
249 | + <?php $manager->addTicketHidden() ?> | |
250 | 250 | <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $CONF['MaxUploadSize']?>" /> |
251 | 251 | File: |
252 | 252 | <br /> |
@@ -266,15 +266,15 @@ function media_choose() { | ||
266 | 266 | </select> |
267 | 267 | <?php } else { |
268 | 268 | ?> |
269 | - <input name="collection" type="hidden" value="<?php echo htmlspecialchars(requestVar('collection'))?>" /> | |
269 | + <input name="collection" type="hidden" value="<?php echo htmlspecialchars(requestVar('collection'))?>" /> | |
270 | 270 | <?php } // if sizeof |
271 | - ?> | |
271 | + ?> | |
272 | 272 | <br /><br /> |
273 | 273 | <input type="submit" value="<?php echo _UPLOAD_BUTTON?>" /> |
274 | 274 | </div> |
275 | 275 | </form> |
276 | - | |
277 | - <?php | |
276 | + | |
277 | + <?php | |
278 | 278 | media_foot(); |
279 | 279 | } |
280 | 280 |
@@ -286,41 +286,23 @@ function media_upload() { | ||
286 | 286 | global $DIR_MEDIA, $member, $CONF; |
287 | 287 | |
288 | 288 | $uploadInfo = postFileInfo('uploadfile'); |
289 | - | |
289 | + | |
290 | 290 | $filename = $uploadInfo['name']; |
291 | 291 | $filetype = $uploadInfo['type']; |
292 | 292 | $filesize = $uploadInfo['size']; |
293 | 293 | $filetempname = $uploadInfo['tmp_name']; |
294 | - $fileerror = intval($uploadInfo['error']); | |
295 | 294 | |
296 | - switch ($fileerror) | |
297 | - { | |
298 | - case 0: // = UPLOAD_ERR_OK | |
299 | - break; | |
300 | - case 1: // = UPLOAD_ERR_INI_SIZE | |
301 | - case 2: // = UPLOAD_ERR_FORM_SIZE | |
302 | - media_doError(_ERROR_FILE_TOO_BIG); | |
303 | - case 3: // = UPLOAD_ERR_PARTIAL | |
304 | - case 4: // = UPLOAD_ERR_NO_FILE | |
305 | - case 6: // = UPLOAD_ERR_NO_TMP_DIR | |
306 | - case 7: // = UPLOAD_ERR_CANT_WRITE | |
307 | - default: | |
308 | - // include error code for debugging | |
309 | - // (see http://www.php.net/manual/en/features.file-upload.errors.php) | |
310 | - media_doError(_ERROR_BADREQUEST . ' (' . $fileerror . ')'); | |
311 | - } | |
312 | - | |
313 | 295 | if ($filesize > $CONF['MaxUploadSize']) |
314 | 296 | media_doError(_ERROR_FILE_TOO_BIG); |
315 | - | |
297 | + | |
316 | 298 | // check file type against allowed types |
317 | 299 | $ok = 0; |
318 | 300 | $allowedtypes = explode (',', $CONF['AllowedTypes']); |
319 | - foreach ( $allowedtypes as $type ) | |
320 | - if (eregi("\." .$type. "$",$filename)) $ok = 1; | |
301 | + foreach ( $allowedtypes as $type ) | |
302 | + if (eregi("\." .$type. "$",$filename)) $ok = 1; | |
321 | 303 | if (!$ok) media_doError(_ERROR_BADFILETYPE); |
322 | - | |
323 | - if (!is_uploaded_file($filetempname)) | |
304 | + | |
305 | + if (!is_uploaded_file($filetempname)) | |
324 | 306 | media_doError(_ERROR_BADREQUEST); |
325 | 307 | |
326 | 308 | // prefix filename with current date (YYYY-MM-DD-) |
@@ -331,9 +313,9 @@ function media_upload() { | ||
331 | 313 | $collection = requestVar('collection'); |
332 | 314 | $res = MEDIA::addMediaObject($collection, $filetempname, $filename); |
333 | 315 | |
334 | - if ($res != '') | |
316 | + if ($res != '') | |
335 | 317 | media_doError($res); |
336 | - | |
318 | + | |
337 | 319 | // shows updated list afterwards |
338 | 320 | media_select(); |
339 | 321 | } |
@@ -342,11 +324,11 @@ function media_loginAndPassThrough() { | ||
342 | 324 | media_head(); |
343 | 325 | ?> |
344 | 326 | <h1><?php echo _LOGIN_PLEASE?></h1> |
345 | - | |
327 | + | |
346 | 328 | <form method="post" action="media.php"> |
347 | 329 | <div> |
348 | 330 | <input name="action" value="login" type="hidden" /> |
349 | - <input name="collection" value="<?php echo htmlspecialchars(requestVar('collection'))?>" type="hidden" /> | |
331 | + <input name="collection" value="<?php echo htmlspecialchars(requestVar('collection'))?>" type="hidden" /> | |
350 | 332 | <?php echo _LOGINFORM_NAME?>: <input name="login" /> |
351 | 333 | <br /><?php echo _LOGINFORM_PWD?>: <input name="password" type="password" /> |
352 | 334 | <br /><input type="submit" value="<?php echo _LOGIN?>" /> |
@@ -379,33 +361,33 @@ function media_head() { | ||
379 | 361 | <script type="text/javascript"> |
380 | 362 | var type = 0; |
381 | 363 | function setType(val) { type = val; } |
382 | - | |
364 | + | |
383 | 365 | function chooseImage(collection, filename, width, height) { |
384 | - window.opener.focus(); | |
366 | + window.opener.focus(); | |
385 | 367 | window.opener.includeImage(collection, |
386 | - filename, | |
387 | - type == 0 ? 'inline' : 'popup', | |
388 | - width, | |
389 | - height | |
390 | - ); | |
368 | + filename, | |
369 | + type == 0 ? 'inline' : 'popup', | |
370 | + width, | |
371 | + height | |
372 | + ); | |
391 | 373 | window.close(); |
392 | 374 | } |
393 | - | |
375 | + | |
394 | 376 | function chooseOther(collection, filename) { |
395 | - window.opener.focus(); | |
377 | + window.opener.focus(); | |
396 | 378 | window.opener.includeOtherMedia(collection, filename); |
397 | 379 | window.close(); |
398 | - | |
380 | + | |
399 | 381 | } |
400 | 382 | </script> |
401 | 383 | </head> |
402 | - <body> | |
384 | + <body> | |
403 | 385 | <?php } |
404 | 386 | |
405 | 387 | function media_foot() { |
406 | 388 | ?> |
407 | 389 | </body> |
408 | - </html> | |
409 | -<?php } | |
390 | + </html> | |
391 | +<?php } | |
410 | 392 | |
411 | 393 | ?> |
@@ -1,24 +1,24 @@ | ||
1 | 1 | <?php |
2 | 2 | /* |
3 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | - * Copyright (C) 2002-2007 The Nucleus Group | |
5 | - * | |
6 | - * This program is free software; you can redistribute it and/or | |
7 | - * modify it under the terms of the GNU General Public License | |
8 | - * as published by the Free Software Foundation; either version 2 | |
9 | - * of the License, or (at your option) any later version. | |
10 | - * (see nucleus/documentation/index.html#license for more info) | |
11 | - */ | |
12 | - | |
3 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | + * Copyright (C) 2002-2005 The Nucleus Group | |
5 | + * | |
6 | + * This program is free software; you can redistribute it and/or | |
7 | + * modify it under the terms of the GNU General Public License | |
8 | + * as published by the Free Software Foundation; either version 2 | |
9 | + * of the License, or (at your option) any later version. | |
10 | + * (see nucleus/documentation/index.html#license for more info) | |
11 | + */ | |
12 | + | |
13 | 13 | /** |
14 | 14 | * This file contains definitions for the methods in the Blogger API |
15 | 15 | * |
16 | 16 | * @license http://nucleuscms.org/license.txt GNU General Public License |
17 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
18 | - * @version $Id: api_blogger.inc.php,v 1.3.2.2 2007-03-27 11:27:53 kimitake Exp $ | |
19 | - * $NucleusJP: api_blogger.inc.php,v 1.6 2007/02/04 06:28:46 kimitake Exp $ | |
20 | - */ | |
21 | - | |
17 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
18 | + * @version $Id: api_blogger.inc.php,v 1.3.2.3 2007-03-27 11:47:55 kimitake Exp $ | |
19 | + * @version $NucleusJP: api_blogger.inc.php,v 1.3.2.1 2005/08/23 08:08:38 kimitake Exp $ | |
20 | + */ | |
21 | + | |
22 | 22 | |
23 | 23 | // blogger.newPost |
24 | 24 | $f_blogger_newPost_sig = array(array( |
@@ -41,10 +41,10 @@ | ||
41 | 41 | $password = _getScalar($m,3); |
42 | 42 | $content = _getScalar($m,4); |
43 | 43 | $publish = _getScalar($m,5); |
44 | - | |
44 | + | |
45 | 45 | $title = blogger_extractTitle($content); |
46 | 46 | $category = blogger_extractCategory($content); |
47 | - $content = blogger_removeSpecialTags($content); | |
47 | + $content = blogger_removeSpecialTags($content); | |
48 | 48 | |
49 | 49 | return _addItem($blogid, $username, $password, $title, $content, '', $publish, 0, $category); |
50 | 50 | } |
@@ -66,7 +66,7 @@ | ||
66 | 66 | $f_blogger_editPost_doc = "Edits an item of a blog"; |
67 | 67 | function f_blogger_editPost($m) { |
68 | 68 | global $manager; |
69 | - | |
69 | + | |
70 | 70 | $itemid = intval(_getScalar($m,1)); |
71 | 71 | $username = _getScalar($m,2); |
72 | 72 | $password = _getScalar($m,3); |
@@ -75,9 +75,9 @@ | ||
75 | 75 | |
76 | 76 | $title = blogger_extractTitle($content); |
77 | 77 | $category = blogger_extractCategory($content); |
78 | - $content = blogger_removeSpecialTags($content); | |
78 | + $content = blogger_removeSpecialTags($content); | |
79 | 79 | |
80 | - // get old title and extended part | |
80 | + // get old title and extended part | |
81 | 81 | if (!$manager->existsItem($itemid,1,1)) |
82 | 82 | return _error(6,"No such item ($itemid)"); |
83 | 83 | $old =& $manager->getItem($itemid,1,1); |
@@ -86,7 +86,7 @@ | ||
86 | 86 | |
87 | 87 | $blog = new BLOG($blogid); |
88 | 88 | $catid = $blog->getCategoryIdFromName($category); |
89 | - | |
89 | + | |
90 | 90 | if ($old['draft'] && $publish) { |
91 | 91 | $wasdraft = 1; |
92 | 92 | $publish = 1; |
@@ -265,19 +265,19 @@ | ||
265 | 265 | |
266 | 266 | |
267 | 267 | /** |
268 | - * Returns a list of recent items | |
268 | + * Returns a list of recent items | |
269 | 269 | */ |
270 | 270 | function _getRecentItemsBlogger($blogid, $username, $password, $amount) { |
271 | - | |
271 | + | |
272 | 272 | $blogid = intval($blogid); |
273 | 273 | $amount = intval($amount); |
274 | - | |
274 | + | |
275 | 275 | // 1. login |
276 | 276 | $mem = new MEMBER(); |
277 | 277 | if (!$mem->login($username, $password)) |
278 | 278 | return _error(1,"Could not log in"); |
279 | 279 | |
280 | - // 2. check if allowed | |
280 | + // 2. check if allowed | |
281 | 281 | if (!BLOG::existsID($blogid)) |
282 | 282 | return _error(2,"No such blog ($blogid)"); |
283 | 283 | if (!$mem->teamRights($blogid)) |
@@ -288,7 +288,7 @@ | ||
288 | 288 | |
289 | 289 | // 3. create and return list of recent items |
290 | 290 | // Struct returned has dateCreated, userid, blogid and content |
291 | - | |
291 | + | |
292 | 292 | $blog = new BLOG($blogid); |
293 | 293 | |
294 | 294 | $structarray = array(); // the array in which the structs will be stored |
@@ -299,15 +299,15 @@ | ||
299 | 299 | ." ORDER BY itime DESC" |
300 | 300 | ." LIMIT $amount"; |
301 | 301 | $r = sql_query($query); |
302 | - | |
302 | + | |
303 | 303 | while ($row = mysql_fetch_assoc($r)) { |
304 | - | |
304 | + | |
305 | 305 | // remove linebreaks if needed |
306 | 306 | if ($blog->convertBreaks()) |
307 | 307 | $row['ibody'] = removeBreaks($row['ibody']); |
308 | 308 | |
309 | 309 | $content = blogger_specialTags($row) . $row['ibody']; |
310 | - | |
310 | + | |
311 | 311 | $newstruct = new xmlrpcval(array( |
312 | 312 | "userid" => new xmlrpcval($row['iauthor'],"string"), |
313 | 313 | "dateCreated" => new xmlrpcval(iso8601_encode(strtotime($row['itime'])),"dateTime.iso8601"), |
@@ -317,25 +317,25 @@ | ||
317 | 317 | "authorName" => new xmlrpcval($row['mname'],'string'), |
318 | 318 | "title" => new xmlrpcval($row['title'],'string'), |
319 | 319 | ),'struct'); |
320 | - array_push($structarray, $newstruct); | |
320 | + array_push($structarray, $newstruct); | |
321 | 321 | } |
322 | 322 | |
323 | 323 | return new xmlrpcresp(new xmlrpcval( $structarray , "array")); |
324 | 324 | |
325 | 325 | } |
326 | - | |
326 | + | |
327 | 327 | /** |
328 | 328 | * Returns one item (Blogger version) |
329 | 329 | */ |
330 | 330 | function _getItemBlogger($itemid, $username, $password) { |
331 | 331 | global $manager; |
332 | - | |
332 | + | |
333 | 333 | // 1. login |
334 | 334 | $mem = new MEMBER(); |
335 | 335 | if (!$mem->login($username, $password)) |
336 | 336 | return _error(1,"Could not log in"); |
337 | 337 | |
338 | - // 2. check if allowed | |
338 | + // 2. check if allowed | |
339 | 339 | if (!$manager->existsItem($itemid,1,1)) |
340 | 340 | return _error(6,"No such item ($itemid)"); |
341 | 341 | $blogid = getBlogIDFromItemID($itemid); |
@@ -347,10 +347,10 @@ | ||
347 | 347 | |
348 | 348 | $item =& $manager->getItem($itemid,1,1); // (also allow drafts and future items) |
349 | 349 | $blog = new BLOG($blogid); |
350 | - | |
350 | + | |
351 | 351 | // get category |
352 | 352 | $item['category'] = $blog->getCategoryName($item['catid']); |
353 | - | |
353 | + | |
354 | 354 | // remove linebreaks if needed |
355 | 355 | if ($blog->convertBreaks()) |
356 | 356 | $item['body'] = removeBreaks($item['body']); |
@@ -376,10 +376,10 @@ | ||
376 | 376 | |
377 | 377 | function blogger_extractCategory($body) { |
378 | 378 | return blogger_matchTag('category',$body); |
379 | - } | |
380 | - | |
379 | + } | |
380 | + | |
381 | 381 | function blogger_matchTag($tag, $body) { |
382 | - if (preg_match("/<" . $tag .">(.+?)<\/".$tag.">/is",$body,$match)) | |
382 | + if (preg_match("/<" . $tag .">(.+?)<\/".$tag.">/is",$body,$match)) | |
383 | 383 | return $match[1]; |
384 | 384 | else |
385 | 385 | return ""; |
@@ -390,13 +390,13 @@ | ||
390 | 390 | $body = preg_replace("/<category>(.+?)<\/category>/","",$body); |
391 | 391 | return trim($body); |
392 | 392 | } |
393 | - | |
393 | + | |
394 | 394 | function blogger_specialTags($item) { |
395 | 395 | $result = "<title>". $item['title']."</title>"; |
396 | 396 | $result .= "<category>".$item['category']."</category>"; |
397 | 397 | return $result; |
398 | 398 | } |
399 | - | |
399 | + | |
400 | 400 | |
401 | 401 | |
402 | 402 | $functionDefs = array_merge($functionDefs, |
@@ -445,7 +445,7 @@ | ||
445 | 445 | array( "function" => "f_blogger_setTemplate", |
446 | 446 | "signature" => $f_blogger_setTemplate_sig, |
447 | 447 | "docstring" => $f_blogger_setTemplate_doc) |
448 | - | |
448 | + | |
449 | 449 | ) |
450 | 450 | ); |
451 | 451 |
@@ -1,26 +1,26 @@ | ||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* |
4 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
5 | - * Copyright (C) 2002-2007 The Nucleus Group | |
6 | - * | |
7 | - * This program is free software; you can redistribute it and/or | |
8 | - * modify it under the terms of the GNU General Public License | |
9 | - * as published by the Free Software Foundation; either version 2 | |
10 | - * of the License, or (at your option) any later version. | |
11 | - * (see nucleus/documentation/index.html#license for more info) | |
12 | - */ | |
4 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
5 | + * Copyright (C) 2002-2005 The Nucleus Group | |
6 | + * | |
7 | + * This program is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GNU General Public License | |
9 | + * as published by the Free Software Foundation; either version 2 | |
10 | + * of the License, or (at your option) any later version. | |
11 | + * (see nucleus/documentation/index.html#license for more info) | |
12 | + */ | |
13 | 13 | |
14 | 14 | /** |
15 | 15 | * This file contains definitions for the methods of the metaWeblog API |
16 | 16 | * |
17 | 17 | * @license http://nucleuscms.org/license.txt GNU General Public License |
18 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
19 | - * @version $Id: api_metaweblog.inc.php,v 1.3.2.2 2007-03-27 11:27:53 kimitake Exp $ | |
20 | - * $NucleusJP: api_metaweblog.inc.php,v 1.6 2007/02/04 06:28:46 kimitake Exp $ | |
21 | - */ | |
22 | - | |
23 | - | |
18 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
19 | + * @version $Id: api_metaweblog.inc.php,v 1.3.2.3 2007-03-27 11:47:55 kimitake Exp $ | |
20 | + * @version $NucleusJP: api_metaweblog.inc.php,v 1.3.2.1 2005/08/23 08:08:38 kimitake Exp $ | |
21 | + */ | |
22 | + | |
23 | + | |
24 | 24 | // metaWeblog.newPost |
25 | 25 | $f_metaWeblog_newPost_sig = array(array( |
26 | 26 | // return type |
@@ -43,15 +43,15 @@ | ||
43 | 43 | $password = _getScalar($m,2); |
44 | 44 | $struct = $m->getParam(3); |
45 | 45 | |
46 | - $content = _getStructVal($struct, 'description'); | |
47 | - $more = _getStructVal($struct, 'mt_text_more'); | |
48 | - $title = _getStructVal($struct, 'title'); | |
46 | + $content = _getStructVal($struct, 'description'); | |
47 | + $more = _getStructVal($struct, 'mt_text_more'); | |
48 | + $title = _getStructVal($struct, 'title'); | |
49 | + | |
50 | + // category is optional (thus: be careful)! | |
51 | + $catlist = $struct->structmem('categories'); | |
52 | + if ($catlist && ($catlist->kindOf() == "array") && ($catlist->arraysize() > 0)) | |
53 | + $category = _getArrayVal($catlist, 0); | |
49 | 54 | |
50 | - // category is optional (thus: be careful)! | |
51 | - $catlist = $struct->structmem('categories'); | |
52 | - if ($catlist && ($catlist->kindOf() == "array") && ($catlist->arraysize() > 0)) | |
53 | - $category = _getArrayVal($catlist, 0); | |
54 | - | |
55 | 55 | |
56 | 56 | $comments = (int) _getStructVal($struct, 'mt_allow_comments') ? 0 : 1; |
57 | 57 | $publish = _getScalar($m,4); |
@@ -75,48 +75,48 @@ | ||
75 | 75 | return $res; |
76 | 76 | } |
77 | 77 | |
78 | - | |
78 | + | |
79 | 79 | // metaWeblog.getCategories |
80 | 80 | $f_metaWeblog_getCategories_sig = array(array( |
81 | 81 | // return |
82 | 82 | $xmlrpcStruct, // categories for blog |
83 | - | |
83 | + | |
84 | 84 | // params |
85 | 85 | $xmlrpcString, // blogid |
86 | 86 | $xmlrpcString, // username |
87 | 87 | $xmlrpcString, // password |
88 | - | |
88 | + | |
89 | 89 | )); |
90 | 90 | $f_metaWeblog_getCategories_doc = "Returns the categories for a given blog"; |
91 | 91 | function f_metaWeblog_getCategories($m) { |
92 | 92 | $blogid = _getScalar($m,0); |
93 | 93 | $username = _getScalar($m,1); |
94 | 94 | $password = _getScalar($m,2); |
95 | - | |
95 | + | |
96 | 96 | return _categoryList($blogid, $username, $password); |
97 | 97 | } |
98 | - | |
98 | + | |
99 | 99 | |
100 | 100 | // metaWeblog.getPost |
101 | 101 | $f_metaWeblog_getPost_sig = array(array( |
102 | 102 | // return |
103 | - $xmlrpcStruct, // the juice | |
104 | - | |
103 | + $xmlrpcStruct, // the juice | |
104 | + | |
105 | 105 | // params |
106 | 106 | $xmlrpcString, // itemid |
107 | 107 | $xmlrpcString, // username |
108 | 108 | $xmlrpcString, // password |
109 | - | |
109 | + | |
110 | 110 | )); |
111 | 111 | $f_metaWeblog_getPost_doc = "Retrieves a post"; |
112 | 112 | function f_metaWeblog_getPost($m) { |
113 | 113 | $itemid = _getScalar($m,0); |
114 | 114 | $username = _getScalar($m,1); |
115 | 115 | $password = _getScalar($m,2); |
116 | - | |
116 | + | |
117 | 117 | return _mw_getPost($itemid, $username, $password); |
118 | 118 | } |
119 | - | |
119 | + | |
120 | 120 | |
121 | 121 | // metaWeblog.editPost |
122 | 122 | $f_metaWeblog_editPost_sig = array(array( |
@@ -148,18 +148,17 @@ | ||
148 | 148 | $catlist = $struct->structmem('categories'); |
149 | 149 | if ($catlist && ($catlist->kindOf() == "array") && ($catlist->arraysize() > 0)) { |
150 | 150 | $category = _getArrayVal($catlist, 0); |
151 | - } | |
152 | - | |
151 | + } | |
152 | + | |
153 | 153 | $publish = _getScalar($m,4); |
154 | 154 | |
155 | - | |
156 | - // get old title and extended part | |
155 | + // get old title and extended part | |
157 | 156 | if (!$manager->existsItem($itemid,1,1)) |
158 | 157 | return _error(6,"No such item ($itemid)"); |
159 | 158 | $blogid = getBlogIDFromItemID($itemid); |
160 | 159 | |
161 | 160 | $old =& $manager->getItem($itemid,1,1); |
162 | - | |
161 | + | |
163 | 162 | if ($category == '') |
164 | 163 | { |
165 | 164 | // leave category unchanged when not present |
@@ -170,7 +169,7 @@ | ||
170 | 169 | $blog = new BLOG($blogid); |
171 | 170 | $catid = $blog->getCategoryIdFromName($category); |
172 | 171 | } |
173 | - | |
172 | + | |
174 | 173 | if ($old['draft'] && $publish) { |
175 | 174 | $wasdraft = 1; |
176 | 175 | $publish = 1; |
@@ -208,12 +207,12 @@ | ||
208 | 207 | |
209 | 208 | return $res; |
210 | 209 | } |
211 | - | |
210 | + | |
212 | 211 | // metaWeblog.newMediaObject |
213 | 212 | $f_metaWeblog_newMediaObject_sig = array(array( |
214 | 213 | // return type |
215 | 214 | $xmlrpcStruct, // "url" element |
216 | - | |
215 | + | |
217 | 216 | // params |
218 | 217 | $xmlrpcString, // blogid |
219 | 218 | $xmlrpcString, // username |
@@ -225,15 +224,15 @@ | ||
225 | 224 | $blogid = _getScalar($m, 0); |
226 | 225 | $username = _getScalar($m, 1); |
227 | 226 | $password = _getScalar($m, 2); |
228 | - | |
227 | + | |
229 | 228 | $struct = $m->getParam(3); |
230 | 229 | $name = _getStructVal($struct, 'name'); |
231 | 230 | $type = _getStructVal($struct, 'type'); |
232 | 231 | $bits = _getStructVal($struct, 'bits'); |
233 | - | |
232 | + | |
234 | 233 | return _newMediaObject($blogid, $username, $password, array('name' => $name, 'type' => $type, 'bits' => $bits)); |
235 | 234 | } |
236 | - | |
235 | + | |
237 | 236 | // metaWeblog.getRecentPosts |
238 | 237 | $f_metaWeblog_getRecentPosts_sig = array(array( |
239 | 238 | // return type |
@@ -251,21 +250,21 @@ | ||
251 | 250 | $username = _getScalar($m, 1); |
252 | 251 | $password = _getScalar($m, 2); |
253 | 252 | $amount = intval(_getScalar($m, 3)); |
254 | - | |
255 | - return _getRecentItemsMetaWeblog($blogid, $username, $password, $amount); | |
253 | + | |
254 | + return _getRecentItemsMetaWeblog($blogid, $username, $password, $amount); | |
256 | 255 | } |
257 | - | |
256 | + | |
258 | 257 | function _getRecentItemsMetaWeblog($blogid, $username, $password, $amount) { |
259 | - | |
258 | + | |
260 | 259 | $blogid = intval($blogid); |
261 | 260 | $amount = intval($amount); |
262 | - | |
261 | + | |
263 | 262 | // 1. login |
264 | 263 | $mem = new MEMBER(); |
265 | 264 | if (!$mem->login($username, $password)) |
266 | 265 | return _error(1,"Could not log in"); |
267 | 266 | |
268 | - // 2. check if allowed | |
267 | + // 2. check if allowed | |
269 | 268 | if (!BLOG::existsID($blogid)) |
270 | 269 | return _error(2,"No such blog ($blogid)"); |
271 | 270 | if (!$mem->teamRights($blogid)) |
@@ -276,7 +275,7 @@ | ||
276 | 275 | |
277 | 276 | // 3. create and return list of recent items |
278 | 277 | // Struct returned has dateCreated, userid, blogid and content |
279 | - | |
278 | + | |
280 | 279 | $blog = new BLOG($blogid); |
281 | 280 | |
282 | 281 | $structarray = array(); // the array in which the structs will be stored |
@@ -287,9 +286,9 @@ | ||
287 | 286 | ." ORDER BY itime DESC" |
288 | 287 | ." LIMIT $amount"; |
289 | 288 | $r = sql_query($query); |
290 | - | |
289 | + | |
291 | 290 | while ($row = mysql_fetch_assoc($r)) { |
292 | - | |
291 | + | |
293 | 292 | // remove linebreaks if needed |
294 | 293 | if ($blog->convertBreaks()) { |
295 | 294 | $row['ibody'] = removeBreaks($row['ibody']); |
@@ -314,73 +313,73 @@ | ||
314 | 313 | "mt_allow_comments" => new xmlrpcval($row['iclosed'] ? 0 : 1, "int"), |
315 | 314 | "mt_allow_pings" => new xmlrpcval(1, "int") |
316 | 315 | ),'struct'); |
317 | - | |
316 | + | |
318 | 317 | //TODO: String link? |
319 | 318 | //TODO: String permaLink? |
320 | - | |
321 | - | |
322 | - array_push($structarray, $newstruct); | |
319 | + | |
320 | + | |
321 | + array_push($structarray, $newstruct); | |
323 | 322 | } |
324 | 323 | |
325 | 324 | return new xmlrpcresp(new xmlrpcval( $structarray , "array")); |
326 | 325 | } |
327 | - | |
326 | + | |
328 | 327 | function _newMediaObject($blogid, $username, $password, $info) { |
329 | 328 | global $CONF, $DIR_MEDIA, $DIR_LIBS; |
330 | - | |
329 | + | |
331 | 330 | // - login |
332 | 331 | $mem = new MEMBER(); |
333 | 332 | if (!$mem->login($username, $password)) |
334 | 333 | return _error(1,'Could not log in'); |
335 | - | |
336 | - // - check if team member | |
334 | + | |
335 | + // - check if team member | |
337 | 336 | if (!BLOG::existsID($blogid)) |
338 | 337 | return _error(2,"No such blog ($blogid)"); |
339 | 338 | if (!$mem->teamRights($blogid)) |
340 | 339 | return _error(3,'Not a team member'); |
341 | - | |
340 | + | |
342 | 341 | $b = new BLOG($blogid); |
343 | - | |
342 | + | |
344 | 343 | // - decode data |
345 | 344 | $data = $info['bits']; // decoding was done transparantly by xmlrpclib |
346 | - | |
345 | + | |
347 | 346 | // - check filesize |
348 | 347 | if (strlen($data) > $CONF['MaxUploadSize']) |
349 | 348 | return _error(9, 'filesize is too big'); |
350 | 349 | |
351 | - | |
350 | + | |
352 | 351 | // - check if filetype is allowed (check filename) |
353 | 352 | $filename = $info['name']; |
354 | 353 | $ok = 0; |
355 | 354 | $allowedtypes = explode (',', $CONF['AllowedTypes']); |
356 | - foreach ( $allowedtypes as $type ) | |
357 | - if (eregi("\." .$type. "$",$filename)) $ok = 1; | |
358 | - if (!$ok) | |
355 | + foreach ( $allowedtypes as $type ) | |
356 | + if (eregi("\." .$type. "$",$filename)) $ok = 1; | |
357 | + if (!$ok) | |
359 | 358 | _error(8, 'Filetype is not allowed'); |
360 | - | |
359 | + | |
361 | 360 | // - add file to media library |
362 | 361 | include_once($DIR_LIBS . 'MEDIA.php'); // media classes |
363 | - | |
362 | + | |
364 | 363 | // always use private media library of member |
365 | 364 | $collection = $mem->getID(); |
366 | 365 | |
367 | 366 | // prefix filename with current date (YYYY-MM-DD-) |
368 | 367 | // this to avoid nameclashes |
369 | 368 | if ($CONF['MediaPrefix']) |
370 | - $filename = strftime("%Y%m%d-", time()) . $filename; | |
371 | - | |
369 | + $filename = strftime("%Y%m%d-", time()) . $filename; | |
370 | + | |
372 | 371 | $res = MEDIA::addMediaObjectRaw($collection, $filename, $data); |
373 | 372 | if ($res) |
374 | 373 | return _error(10, $res); |
375 | - | |
374 | + | |
376 | 375 | // - return URL |
377 | 376 | $urlstruct = new xmlrpcval(array( |
378 | 377 | "url" => new xmlrpcval($CONF['MediaURL'] . $collection. '/' . $filename,'string') |
379 | - ),'struct'); | |
380 | - | |
378 | + ),'struct'); | |
379 | + | |
381 | 380 | return new xmlrpcresp($urlstruct); |
382 | 381 | } |
383 | - | |
382 | + | |
384 | 383 | function _categoryList($blogid, $username, $password) { |
385 | 384 | // 1. login |
386 | 385 | $mem = new MEMBER(); |
@@ -392,9 +391,9 @@ | ||
392 | 391 | return _error(2,"No such blog ($blogid)"); |
393 | 392 | if (!$mem->teamRights($blogid)) |
394 | 393 | return _error(3,"Not a team member"); |
395 | - | |
394 | + | |
396 | 395 | $b = new BLOG($blogid); |
397 | - | |
396 | + | |
398 | 397 | $categorystruct = array(); |
399 | 398 | |
400 | 399 | $query = "SELECT cname, cdesc, catid" |
@@ -413,22 +412,22 @@ | ||
413 | 412 | ) |
414 | 413 | ,'struct'); |
415 | 414 | } |
416 | - | |
417 | - | |
415 | + | |
416 | + | |
418 | 417 | return new xmlrpcresp(new xmlrpcval( $categorystruct , "struct")); |
419 | - | |
418 | + | |
420 | 419 | } |
421 | - | |
422 | - | |
420 | + | |
421 | + | |
423 | 422 | function _mw_getPost($itemid, $username, $password) { |
424 | 423 | global $manager; |
425 | - | |
424 | + | |
426 | 425 | // 1. login |
427 | 426 | $mem = new MEMBER(); |
428 | 427 | if (!$mem->login($username, $password)) |
429 | 428 | return _error(1,"Could not log in"); |
430 | 429 | |
431 | - // 2. check if allowed | |
430 | + // 2. check if allowed | |
432 | 431 | if (!$manager->existsItem($itemid,1,1)) |
433 | 432 | return _error(6,"No such item ($itemid)"); |
434 | 433 | $blogid = getBlogIDFromItemID($itemid); |
@@ -437,13 +436,13 @@ | ||
437 | 436 | |
438 | 437 | // 3. return the item |
439 | 438 | $item =& $manager->getItem($itemid,1,1); // (also allow drafts and future items) |
440 | - | |
439 | + | |
441 | 440 | $b = new BLOG($blogid); |
442 | 441 | if ($b->convertBreaks()) { |
443 | 442 | $item['body'] = removeBreaks($item['body']); |
444 | 443 | $item['more'] = removeBreaks($item['more']); |
445 | 444 | } |
446 | - | |
445 | + | |
447 | 446 | $categoryname = $b->getCategoryName($item['catid']); |
448 | 447 | |
449 | 448 | $newstruct = new xmlrpcval(array( |
@@ -463,14 +462,14 @@ | ||
463 | 462 | "mt_allow_comments" => new xmlrpcval($item['closed'] ? 0 : 1, "int"), |
464 | 463 | "mt_allow_pings" => new xmlrpcval(1, "int") |
465 | 464 | ),'struct'); |
466 | - | |
465 | + | |
467 | 466 | //TODO: add "String link" to struct? |
468 | - //TODO: add "String permaLink" to struct? | |
467 | + //TODO: add "String permaLink" to struct? | |
469 | 468 | |
470 | 469 | return new xmlrpcresp($newstruct); |
471 | - | |
470 | + | |
472 | 471 | } |
473 | - | |
472 | + | |
474 | 473 | $functionDefs = array_merge($functionDefs, |
475 | 474 | array( |
476 | 475 | "metaWeblog.newPost" => |
@@ -485,14 +484,14 @@ | ||
485 | 484 | "function" => "f_metaWeblog_getCategories", |
486 | 485 | "signature" => $f_metaWeblog_getCategories_sig, |
487 | 486 | "docstring" => $f_metaWeblog_getCategories_doc |
488 | - ), | |
487 | + ), | |
489 | 488 | |
490 | 489 | "metaWeblog.getPost" => |
491 | 490 | array( |
492 | 491 | "function" => "f_metaWeblog_getPost", |
493 | 492 | "signature" => $f_metaWeblog_getPost_sig, |
494 | 493 | "docstring" => $f_metaWeblog_getPost_doc |
495 | - ), | |
494 | + ), | |
496 | 495 | |
497 | 496 | "metaWeblog.editPost" => |
498 | 497 | array( |
@@ -500,21 +499,21 @@ | ||
500 | 499 | "signature" => $f_metaWeblog_editPost_sig, |
501 | 500 | "docstring" => $f_metaWeblog_editPost_doc |
502 | 501 | ), |
503 | - | |
502 | + | |
504 | 503 | 'metaWeblog.newMediaObject' => |
505 | 504 | array( |
506 | - 'function' => 'f_metaWeblog_newMediaObject', | |
507 | - 'signature' => $f_metaWeblog_newMediaObject_sig, | |
508 | - 'docstring' => $f_metaWeblog_newMediaObject_doc | |
505 | + 'function' => 'f_metaWeblog_newMediaObject', | |
506 | + 'signature' => $f_metaWeblog_newMediaObject_sig, | |
507 | + 'docstring' => $f_metaWeblog_newMediaObject_doc | |
509 | 508 | ), |
510 | - | |
509 | + | |
511 | 510 | 'metaWeblog.getRecentPosts' => |
512 | 511 | array( |
513 | - 'function' => 'f_metaWeblog_getRecentPosts', | |
514 | - 'signature' => $f_metaWeblog_getRecentPosts_sig, | |
515 | - 'docstring' => $f_metaWeblog_getRecentPosts_doc | |
516 | - ) | |
517 | - | |
512 | + 'function' => 'f_metaWeblog_getRecentPosts', | |
513 | + 'signature' => $f_metaWeblog_getRecentPosts_sig, | |
514 | + 'docstring' => $f_metaWeblog_getRecentPosts_doc | |
515 | + ) | |
516 | + | |
518 | 517 | ) |
519 | 518 | ); |
520 | -?> | |
\ No newline at end of file | ||
519 | +?> |
@@ -1,24 +1,26 @@ | ||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* |
4 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
5 | - * Copyright (C) 2002-2007 The Nucleus Group | |
6 | - * | |
7 | - * This program is free software; you can redistribute it and/or | |
8 | - * modify it under the terms of the GNU General Public License | |
9 | - * as published by the Free Software Foundation; either version 2 | |
10 | - * of the License, or (at your option) any later version. | |
11 | - * (see nucleus/documentation/index.html#license for more info) | |
12 | - */ | |
4 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
5 | + * Copyright (C) 2002-2005 The Nucleus Group | |
6 | + * | |
7 | + * This program is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GNU General Public License | |
9 | + * as published by the Free Software Foundation; either version 2 | |
10 | + * of the License, or (at your option) any later version. | |
11 | + * (see nucleus/documentation/index.html#license for more info) | |
12 | + */ | |
13 | 13 | /** |
14 | 14 | * This file contains definitions for the methods in the Movable Type API |
15 | 15 | * |
16 | 16 | * Wouter Demuynck 2003-08-31 |
17 | 17 | * |
18 | 18 | * @license http://nucleuscms.org/license.txt GNU General Public License |
19 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
20 | - * $NucleusJP: api_mt.inc.php,v 1.6 2007/02/04 06:28:46 kimitake Exp $ | |
21 | - */ | |
19 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
20 | + * @version $Id: api_mt.inc.php,v 1.3.2.3 2007-03-27 11:47:55 kimitake Exp $ | |
21 | + * @version $NucleusJP: api_mt.inc.php,v 1.3.2.1 2005/08/23 08:08:38 kimitake Exp $ | |
22 | + */ | |
23 | + | |
22 | 24 | |
23 | 25 | // mt.supportedMethods |
24 | 26 | $f_mt_supportedMethods_sig = array(array( |
@@ -27,7 +29,7 @@ | ||
27 | 29 | )); |
28 | 30 | $f_mt_supportedMethods_doc = 'returns an array of supported methods'; |
29 | 31 | function f_mt_supportedMethods($m) { |
30 | - $res = new xmlrpcresp(new xmlrpcval( | |
32 | + $res = new xmlrpcresp(new xmlrpcval( | |
31 | 33 | array( |
32 | 34 | new xmlrpcval('mt.supportedMethods', 'string'), |
33 | 35 | new xmlrpcval('mt.supportedTextFilters', 'string'), |
@@ -41,7 +43,7 @@ | ||
41 | 43 | ); |
42 | 44 | return $res; |
43 | 45 | } |
44 | - | |
46 | + | |
45 | 47 | // mt.supportedTextFilters |
46 | 48 | $f_mt_supportedTextFilters_sig = array(array( |
47 | 49 | // return type |
@@ -49,24 +51,24 @@ | ||
49 | 51 | )); |
50 | 52 | $f_mt_supportedTextFilters_doc = 'returns the supported text filters'; |
51 | 53 | function f_mt_supportedTextFilters($m) { |
52 | - $res = new xmlrpcresp(new xmlrpcval( | |
54 | + $res = new xmlrpcresp(new xmlrpcval( | |
53 | 55 | array( |
54 | 56 | // no text filters in nucleus |
55 | 57 | ), 'array') |
56 | 58 | ); |
57 | 59 | return $res; |
58 | 60 | } |
59 | - | |
61 | + | |
60 | 62 | // mt.getCategoryList |
61 | 63 | $f_mt_getCategoryList_sig = array(array( |
62 | 64 | // return type |
63 | 65 | $xmlrpcArray, // array of structs |
64 | - | |
66 | + | |
65 | 67 | // params |
66 | 68 | $xmlrpcString, // blogid |
67 | 69 | $xmlrpcString, // username |
68 | 70 | $xmlrpcString // password |
69 | - | |
71 | + | |
70 | 72 | )); |
71 | 73 | $f_mt_getCategoryList_doc = 'Returns a list of all categories defined in the weblog'; |
72 | 74 | function f_mt_getCategoryList($m) { |
@@ -76,12 +78,12 @@ | ||
76 | 78 | |
77 | 79 | return _mt_categoryList($blogid, $username, $password); |
78 | 80 | } |
79 | - | |
81 | + | |
80 | 82 | // mt.publishPost |
81 | 83 | $f_mt_publishPost_sig = array(array( |
82 | 84 | // return type |
83 | 85 | $xmlrpcBoolean, // true |
84 | - | |
86 | + | |
85 | 87 | // params |
86 | 88 | $xmlrpcString, // itemid |
87 | 89 | $xmlrpcString, // username |
@@ -91,11 +93,11 @@ | ||
91 | 93 | function f_mt_publishPost($m) { |
92 | 94 | $itemid = intval(_getScalar($m, 0)); |
93 | 95 | $username = _getScalar($m, 1); |
94 | - $password = _getScalar($m, 2); | |
95 | - | |
96 | + $password = _getScalar($m, 2); | |
97 | + | |
96 | 98 | return _mt_publishPost($itemid, $username, $password); |
97 | 99 | } |
98 | - | |
100 | + | |
99 | 101 | // mt.getPostCategories |
100 | 102 | $f_mt_getPostCategories_sig = array(array( |
101 | 103 | // return |
@@ -110,7 +112,7 @@ | ||
110 | 112 | $itemid = intval(_getScalar($m, 0)); |
111 | 113 | $username = _getScalar($m, 1); |
112 | 114 | $password = _getScalar($m, 2); |
113 | - | |
115 | + | |
114 | 116 | return _mt_getPostCategories($itemid, $username, $password); |
115 | 117 | } |
116 | 118 |
@@ -131,7 +133,7 @@ | ||
131 | 133 | $password = _getScalar($m, 2); |
132 | 134 | |
133 | 135 | $categories = $m->getParam(3); |
134 | - $iSize = $categories->arraysize(); | |
136 | + $iSize = $categories->arraysize(); | |
135 | 137 | |
136 | 138 | $category = ''; |
137 | 139 | for ($i=0;$i<$iSize;$i++) { |
@@ -141,18 +143,18 @@ | ||
141 | 143 | $bPrimary = $bPrimary->scalarval(); |
142 | 144 | else if (!$category) |
143 | 145 | $bPrimary = 1; // "Using isPrimary to set the primary category is optional-- |
144 | - // in the absence of this flag, the first struct in the array | |
146 | + // in the absence of this flag, the first struct in the array | |
145 | 147 | // will be assigned the primary category for the post." (MT doc) |
146 | 148 | if ($bPrimary) { |
147 | 149 | $category = $struct->structmem('categoryId'); |
148 | 150 | $category = $category->scalarval(); |
149 | 151 | } |
150 | - | |
152 | + | |
151 | 153 | } |
152 | - | |
154 | + | |
153 | 155 | return _mt_setPostCategories($itemid, $username, $password, $category); |
154 | 156 | } |
155 | - | |
157 | + | |
156 | 158 | // mt.getRecentPostTitles |
157 | 159 | $f_mt_getRecentPostTitles_sig = array(array( |
158 | 160 | // return |
@@ -166,10 +168,10 @@ | ||
166 | 168 | $f_mt_getRecentPostTitles_doc = 'Returns a bandwidth-friendly list of the most recent posts in the system.'; |
167 | 169 | function f_mt_getRecentPostTitles($m) { |
168 | 170 | $blogid = intval(_getScalar($m, 0)); |
169 | - $username = _getScalar($m, 1); | |
171 | + $username = _getScalar($m, 1); | |
170 | 172 | $password = _getScalar($m, 2); |
171 | 173 | $iAmount = intval(_getScalar($m, 3)); |
172 | - | |
174 | + | |
173 | 175 | return _mt_getRecentPostTitles($blogid, $username, $password, $iAmount); |
174 | 176 | } |
175 | 177 |
@@ -185,7 +187,7 @@ | ||
185 | 187 | global $manager; |
186 | 188 | |
187 | 189 | $itemid = intval(_getScalar($m, 0)); |
188 | - | |
190 | + | |
189 | 191 | $trackbacks = array (); |
190 | 192 | $tbstruct = array (); |
191 | 193 |
@@ -203,39 +205,39 @@ | ||
203 | 205 | |
204 | 206 | return new xmlrpcresp(new xmlrpcval( $tbstruct , "array")); |
205 | 207 | } |
206 | - | |
208 | + | |
207 | 209 | $functionDefs = array_merge($functionDefs, |
208 | 210 | array( |
209 | 211 | "mt.supportedMethods" => |
210 | 212 | array( "function" => "f_mt_supportedMethods", |
211 | 213 | "signature" => $f_mt_supportedMethods_sig, |
212 | 214 | "docstring" => $f_mt_supportedMethods_doc), |
213 | - | |
215 | + | |
214 | 216 | "mt.supportedTextFilters" => |
215 | 217 | array( "function" => "f_mt_supportedTextFilters", |
216 | 218 | "signature" => $f_mt_supportedTextFilters_sig, |
217 | 219 | "docstring" => $f_mt_supportedTextFilters_doc), |
218 | - | |
220 | + | |
219 | 221 | "mt.getCategoryList" => |
220 | 222 | array( "function" => "f_mt_getCategoryList", |
221 | 223 | "signature" => $f_mt_getCategoryList_sig, |
222 | 224 | "docstring" => $f_mt_getCategoryList_doc), |
223 | - | |
225 | + | |
224 | 226 | "mt.publishPost" => |
225 | 227 | array( "function" => "f_mt_publishPost", |
226 | 228 | "signature" => $f_mt_publishPost_sig, |
227 | 229 | "docstring" => $f_mt_publishPost_doc), |
228 | - | |
230 | + | |
229 | 231 | "mt.getPostCategories" => |
230 | 232 | array( "function" => "f_mt_getPostCategories", |
231 | 233 | "signature" => $f_mt_getPostCategories_sig, |
232 | 234 | "docstring" => $f_mt_getPostCategories_doc), |
233 | - | |
235 | + | |
234 | 236 | "mt.setPostCategories" => |
235 | 237 | array( "function" => "f_mt_setPostCategories", |
236 | 238 | "signature" => $f_mt_setPostCategories_sig, |
237 | 239 | "docstring" => $f_mt_setPostCategories_doc), |
238 | - | |
240 | + | |
239 | 241 | "mt.getRecentPostTitles" => |
240 | 242 | array( "function" => "f_mt_getRecentPostTitles", |
241 | 243 | "signature" => $f_mt_getRecentPostTitles_sig, |
@@ -257,19 +259,19 @@ | ||
257 | 259 | if (!$mem->login($username, $password)) |
258 | 260 | return _error(1,"Could not log in"); |
259 | 261 | |
260 | - // check if item exists | |
262 | + // check if item exists | |
261 | 263 | if (!$manager->existsItem($itemid,1,1)) |
262 | 264 | return _error(6,"No such item ($itemid)"); |
263 | - | |
265 | + | |
264 | 266 | $blogid = getBlogIDFromItemID($itemid); |
265 | 267 | $blog = new BLOG($blogid); |
266 | 268 | |
267 | 269 | if (!$mem->canAlterItem($itemid)) |
268 | 270 | return _error(7,"Not allowed to alter item"); |
271 | + | |
272 | + $old =& $manager->getItem($itemid,1,1); | |
269 | 273 | |
270 | - $old =& $manager->getItem($itemid,1,1); | |
271 | - | |
272 | - $catid = $blog->getCategoryIdFromName($category); | |
274 | + $catid = $blog->getCategoryIdFromName($category); | |
273 | 275 | |
274 | 276 | $publish = 0; |
275 | 277 | if ($old['draft'] && $publish) { |
@@ -278,11 +280,11 @@ | ||
278 | 280 | } else { |
279 | 281 | $wasdraft = 0; |
280 | 282 | } |
281 | - | |
283 | + | |
282 | 284 | return _edititem($itemid, $username, $password, $catid, $old['title'], $old['body'], $old['more'], $wasdraft, $publish, $old['closed']); |
283 | 285 | } |
284 | - | |
285 | - | |
286 | + | |
287 | + | |
286 | 288 | function _mt_getPostCategories($itemid, $username, $password) { |
287 | 289 | global $manager; |
288 | 290 |
@@ -291,7 +293,7 @@ | ||
291 | 293 | if (!$mem->login($username, $password)) |
292 | 294 | return _error(1,"Could not log in"); |
293 | 295 | |
294 | - // check if item exists | |
296 | + // check if item exists | |
295 | 297 | if (!$manager->existsItem($itemid,1,1)) |
296 | 298 | return _error(6,"No such item ($itemid)"); |
297 | 299 |
@@ -300,25 +302,25 @@ | ||
300 | 302 | |
301 | 303 | if (!$mem->canAlterItem($itemid)) |
302 | 304 | return _error(7, 'You are not allowed to request this information'); |
303 | - | |
304 | - $info =& $manager->getItem($itemid,1,1); | |
305 | + | |
306 | + $info =& $manager->getItem($itemid,1,1); | |
305 | 307 | $catName = $blog->getCategoryName($info['catid']); |
306 | - | |
308 | + | |
307 | 309 | $struct = new xmlrpcval( |
308 | 310 | array( |
309 | 311 | 'categoryId' => new xmlrpcval($catName, 'string'), |
310 | 312 | 'categoryName' => new xmlrpcval($catName, 'string'), |
311 | 313 | 'isPrimary' => new xmlrpcval(1, 'boolean') |
312 | 314 | ), 'struct' |
313 | - ); | |
314 | - | |
315 | + ); | |
316 | + | |
315 | 317 | return new xmlrpcresp(new xmlrpcval(array($struct), 'array')); |
316 | 318 | |
317 | 319 | } |
318 | - | |
320 | + | |
319 | 321 | function _mt_publishPost($itemid, $username, $password) { |
320 | 322 | global $manager; |
321 | - | |
323 | + | |
322 | 324 | if (!$manager->existsItem($itemid,1,1)) |
323 | 325 | return _error(6,"No such item ($itemid)"); |
324 | 326 |
@@ -329,8 +331,8 @@ | ||
329 | 331 | |
330 | 332 | return _edititem($itemid, $username, $password, $old['catid'], $old['title'], $old['body'], $old['more'], $old['draft'], 1, $old['closed']); |
331 | 333 | } |
332 | - | |
333 | - | |
334 | + | |
335 | + | |
334 | 336 | function _mt_categoryList($blogid, $username, $password) { |
335 | 337 | // 1. login |
336 | 338 | $mem = new MEMBER(); |
@@ -342,9 +344,9 @@ | ||
342 | 344 | return _error(2,"No such blog ($blogid)"); |
343 | 345 | if (!$mem->teamRights($blogid)) |
344 | 346 | return _error(3,"Not a team member"); |
345 | - | |
347 | + | |
346 | 348 | $b = new BLOG($blogid); |
347 | - | |
349 | + | |
348 | 350 | $categorystruct = array(); |
349 | 351 | |
350 | 352 | $query = "SELECT cname, cdesc, catid" |
@@ -361,25 +363,25 @@ | ||
361 | 363 | "categoryId" => new xmlrpcval($obj->cname,"string") |
362 | 364 | ) |
363 | 365 | ,'struct'); |
364 | - | |
366 | + | |
365 | 367 | } |
366 | - | |
367 | - | |
368 | + | |
369 | + | |
368 | 370 | return new xmlrpcresp(new xmlrpcval( $categorystruct , "array")); |
369 | - | |
371 | + | |
370 | 372 | } |
371 | - | |
372 | - function _mt_getRecentPostTitles($blogid, $username, $password, $iAmount) | |
373 | + | |
374 | + function _mt_getRecentPostTitles($blogid, $username, $password, $iAmount) | |
373 | 375 | { |
374 | 376 | $blogid = intval($blogid); |
375 | 377 | $iAmount = intval($iAmount); |
376 | - | |
378 | + | |
377 | 379 | // 1. login |
378 | 380 | $mem = new MEMBER(); |
379 | 381 | if (!$mem->login($username, $password)) |
380 | 382 | return _error(1,"Could not log in"); |
381 | 383 | |
382 | - // 2. check if allowed | |
384 | + // 2. check if allowed | |
383 | 385 | if (!BLOG::existsID($blogid)) |
384 | 386 | return _error(2,"No such blog ($blogid)"); |
385 | 387 | if (!$mem->teamRights($blogid)) |
@@ -390,7 +392,7 @@ | ||
390 | 392 | |
391 | 393 | // 3. create and return list of recent items |
392 | 394 | // Struct returned has dateCreated, userid, postid and title |
393 | - | |
395 | + | |
394 | 396 | $blog = new BLOG($blogid); |
395 | 397 | |
396 | 398 | $structarray = array(); // the array in which the structs will be stored |
@@ -401,23 +403,23 @@ | ||
401 | 403 | ." ORDER BY itime DESC" |
402 | 404 | ." LIMIT $iAmount"; |
403 | 405 | $r = sql_query($query); |
404 | - | |
406 | + | |
405 | 407 | while ($row = mysql_fetch_assoc($r)) { |
406 | - | |
408 | + | |
407 | 409 | $newstruct = new xmlrpcval(array( |
408 | 410 | "dateCreated" => new xmlrpcval(iso8601_encode(strtotime($row['itime'])),"dateTime.iso8601"), |
409 | 411 | "postid" => new xmlrpcval($row['inumber'],"string"), |
410 | 412 | "title" => new xmlrpcval($row['title'],"string"), |
411 | 413 | "userid" => new xmlrpcval($row['iauthor'],"string") |
412 | 414 | ),'struct'); |
413 | - | |
414 | - array_push($structarray, $newstruct); | |
415 | + | |
416 | + array_push($structarray, $newstruct); | |
415 | 417 | } |
416 | 418 | |
417 | 419 | return new xmlrpcresp(new xmlrpcval( $structarray , "array")); |
418 | - | |
420 | + | |
419 | 421 | } |
422 | + | |
420 | 423 | |
421 | 424 | |
422 | - | |
423 | -?> | |
\ No newline at end of file | ||
425 | +?> |
@@ -1,14 +1,14 @@ | ||
1 | 1 | <?php |
2 | 2 | /* |
3 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | - * Copyright (C) 2002-2007 The Nucleus Group | |
5 | - * | |
6 | - * This program is free software; you can redistribute it and/or | |
7 | - * modify it under the terms of the GNU General Public License | |
8 | - * as published by the Free Software Foundation; either version 2 | |
9 | - * of the License, or (at your option) any later version. | |
10 | - * (see nucleus/documentation/index.html#license for more info) | |
11 | - */ | |
3 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
4 | + * Copyright (C) 2002-2005 The Nucleus Group | |
5 | + * | |
6 | + * This program is free software; you can redistribute it and/or | |
7 | + * modify it under the terms of the GNU General Public License | |
8 | + * as published by the Free Software Foundation; either version 2 | |
9 | + * of the License, or (at your option) any later version. | |
10 | + * (see nucleus/documentation/index.html#license for more info) | |
11 | + */ | |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * This file contains definitions for the functions in the Nucleus API |
@@ -16,10 +16,11 @@ | ||
16 | 16 | * NOTE: These functions are deprecated and will most likely be removed! |
17 | 17 | * |
18 | 18 | * @license http://nucleuscms.org/license.txt GNU General Public License |
19 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
20 | - * @version $Id: api_nucleus.inc.php,v 1.3.2.2 2007-03-27 11:27:53 kimitake Exp $ | |
21 | - * $NucleusJP: api_nucleus.inc.php,v 1.6 2007/02/04 06:28:46 kimitake Exp $ | |
22 | - */ | |
19 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
20 | + * @version $Id: api_nucleus.inc.php,v 1.3.2.3 2007-03-27 11:47:55 kimitake Exp $ | |
21 | + * $NucleusJP: api_nucleus.inc.php,v 1.3.2.1 2005/08/23 08:08:38 kimitake Exp $ | |
22 | + */ | |
23 | + | |
23 | 24 | |
24 | 25 | // nucleus.addItem |
25 | 26 | $f_nucleus_addItem_sig = array(array( |
@@ -102,7 +103,7 @@ | ||
102 | 103 | $f_nucleus_editItem_doc = "Edits an item of a blog"; |
103 | 104 | function f_nucleus_editItem($m) { |
104 | 105 | global $manager; |
105 | - | |
106 | + | |
106 | 107 | $itemid = intval(_getScalar($m,0)); |
107 | 108 | $username = _getScalar($m,1); |
108 | 109 | $password = _getScalar($m,2); |
@@ -112,7 +113,7 @@ | ||
112 | 113 | $publish = _getScalar($m,6); |
113 | 114 | $closed = _getScalar($m,7); |
114 | 115 | |
115 | - // get old title and extended part | |
116 | + // get old title and extended part | |
116 | 117 | if (!$manager->existsItem($itemid,1,1)) |
117 | 118 | return _error(6,"No such item ($itemid)"); |
118 | 119 |
@@ -207,13 +208,13 @@ | ||
207 | 208 | function _getRecentItems($blogid, $username, $password, $amount) { |
208 | 209 | $blogid = intval($blogid); |
209 | 210 | $amount = intval($amount); |
210 | - | |
211 | + | |
211 | 212 | // 1. login |
212 | 213 | $mem = new MEMBER(); |
213 | 214 | if (!$mem->login($username, $password)) |
214 | 215 | return _error(1,"Could not log in"); |
215 | 216 | |
216 | - // 2. check if allowed | |
217 | + // 2. check if allowed | |
217 | 218 | if (!BLOG::existsID($blogid)) |
218 | 219 | return _error(2,"No such blog ($blogid)"); |
219 | 220 | if (!$mem->teamRights($blogid)) |
@@ -244,31 +245,31 @@ | ||
244 | 245 | "draft" => new xmlrpcval($obj->idraft,"boolean"), |
245 | 246 | "closed" => new xmlrpcval($obj->iclosed,"boolean"), |
246 | 247 | ),'struct'); |
247 | - array_push($structarray, $newstruct); | |
248 | + array_push($structarray, $newstruct); | |
248 | 249 | } |
249 | 250 | |
250 | 251 | return new xmlrpcresp(new xmlrpcval( $structarray , "array")); |
251 | 252 | |
252 | 253 | } |
253 | - | |
254 | - | |
254 | + | |
255 | + | |
255 | 256 | |
256 | 257 | /** |
257 | 258 | * Returns one item (Nucleus version) |
258 | 259 | */ |
259 | 260 | function _getItem($itemid, $username, $password) { |
260 | 261 | global $manager; |
261 | - | |
262 | + | |
262 | 263 | // 1. login |
263 | 264 | $mem = new MEMBER(); |
264 | 265 | if (!$mem->login($username, $password)) |
265 | 266 | return _error(1,"Could not log in"); |
266 | 267 | |
267 | - // 2. check if allowed | |
268 | + // 2. check if allowed | |
268 | 269 | if (!$manager->existsItem($itemid,1,1)) |
269 | 270 | return _error(6,"No such item ($itemid)"); |
270 | 271 | $blogid = getBlogIDFromItemID($itemid); |
271 | - | |
272 | + | |
272 | 273 | if (!$mem->teamRights($blogid)) |
273 | 274 | return _error(3,"Not a team member"); |
274 | 275 |
@@ -276,7 +277,7 @@ | ||
276 | 277 | // Structure returned has dateCreated, userid, blogid and content |
277 | 278 | |
278 | 279 | $item =& $manager->getItem($itemid,1,1); // (also allow drafts and future items) |
279 | - | |
280 | + | |
280 | 281 | $blog = new BLOG($blogid); |
281 | 282 | if ($blog->convertBreaks()) |
282 | 283 | $item['body'] = removeBreaks($item['body']); |
@@ -295,7 +296,7 @@ | ||
295 | 296 | return new xmlrpcresp($newstruct); |
296 | 297 | |
297 | 298 | |
298 | - } | |
299 | + } | |
299 | 300 | |
300 | 301 | |
301 | 302 | $functionDefs = array_merge($functionDefs, |
@@ -323,19 +324,19 @@ | ||
323 | 324 | "nucleus.getUsersBlogs" => |
324 | 325 | array( "function" => "f_nucleus_getUsersBlogs", |
325 | 326 | "signature" => $f_nucleus_getUsersBlogs_sig, |
326 | - "docstring" => $f_nucleus_getUsersBlogs_doc), | |
327 | + "docstring" => $f_nucleus_getUsersBlogs_doc), | |
327 | 328 | |
328 | 329 | "nucleus.getRecentItems" => |
329 | 330 | array( "function" => "f_nucleus_getRecentItems", |
330 | 331 | "signature" => $f_nucleus_getRecentItems_sig, |
331 | - "docstring" => $f_nucleus_getRecentItems_doc), | |
332 | + "docstring" => $f_nucleus_getRecentItems_doc), | |
332 | 333 | |
333 | 334 | "nucleus.getItem" => |
334 | 335 | array( "function" => "f_nucleus_getItem", |
335 | 336 | "signature" => $f_nucleus_getItem_sig, |
336 | 337 | "docstring" => $f_nucleus_getItem_doc) |
337 | - ) | |
338 | - | |
338 | + ) | |
339 | + | |
339 | 340 | ); |
340 | 341 | |
341 | -?> | |
\ No newline at end of file | ||
342 | +?> |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | /* |
3 | 3 | * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) |
4 | - * Copyright (C) 2002-2007 The Nucleus Group | |
4 | + * Copyright (C) 2002-2005 The Nucleus Group | |
5 | 5 | * |
6 | 6 | * This program is free software; you can redistribute it and/or |
7 | 7 | * modify it under the terms of the GNU General Public License |
@@ -61,12 +61,12 @@ | ||
61 | 61 | * mt.supportedMethods |
62 | 62 | * |
63 | 63 | * @license http://nucleuscms.org/license.txt GNU General Public License |
64 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
65 | - * @version $Id: server.php,v 1.5.2.4 2007-03-27 11:27:53 kimitake Exp $ | |
66 | - * @version $NucleusJP: server.php,v 1.8 2007/03/20 19:33:25 kmorimatsu Exp $ | |
64 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
65 | + * @version $Id: server.php,v 1.5.2.5 2007-03-27 11:47:55 kimitake Exp $ | |
66 | + * @version $NucleusJP: server.php,v 1.5.2.3 2005/08/23 08:08:38 kimitake Exp $ | |
67 | 67 | */ |
68 | 68 | $CONF = array(); |
69 | -require("../../config.php"); // include Nucleus libs and code | |
69 | +include("../../config.php"); // include Nucleus libs and code | |
70 | 70 | include($DIR_LIBS . "xmlrpc.inc.php"); |
71 | 71 | include($DIR_LIBS . "xmlrpcs.inc.php"); |
72 | 72 |
@@ -325,4 +325,4 @@ function _error($err, $msg) { | ||
325 | 325 | global $xmlrpcerruser; |
326 | 326 | return new xmlrpcresp(0, $xmlrpcerruser + $err, $msg); |
327 | 327 | } |
328 | -?> | |
\ No newline at end of file | ||
328 | +?> |
@@ -5,4 +5,4 @@ include('./config.php'); | ||
5 | 5 | selectSkin('xml/rsd'); |
6 | 6 | selector(); |
7 | 7 | |
8 | -?> | |
\ No newline at end of file | ||
8 | +?> |
@@ -4,23 +4,18 @@ | ||
4 | 4 | <template name="feeds/atom/modified" /> |
5 | 5 | <template name="feeds/atom/entries" /> |
6 | 6 | <info> |
7 | - <![CDATA[Atom 1.0 weblog syndication]]> | |
7 | + <![CDATA[Atom 0.3 weblog syndication]]> | |
8 | 8 | </info> |
9 | 9 | </meta> |
10 | 10 | |
11 | 11 | <skin name="feeds/atom" type="application/atom+xml" includeMode="normal" includePrefix=""> |
12 | - <description>Atom 1.0 weblog syndication</description> | |
12 | + <description>Atom 0.3 weblog syndication</description> | |
13 | 13 | <part name="index"><![CDATA[<?xml version="1.0" encoding="UTF-8"?> |
14 | -<feed xml:lang="ja" xmlns="http://www.w3.org/2005/Atom"> | |
14 | +<feed version="0.3" xmlns="http://purl.org/atom/ns#"> | |
15 | 15 | <title><%blogsetting(name)%></title> |
16 | - <subtitle><%blogsetting(desc)%></subtitle> | |
17 | - <id><%blogsetting(url)%>:<%blogsetting(id)%></id> | |
18 | - | |
19 | 16 | <link rel="alternate" type="text/html" href="<%blogsetting(url)%>" /> |
20 | - <link rel="self" type="application/atom+xml" href="<%blogsetting(url)%><%self%>" /> | |
21 | - <generator uri="http://nucleuscms.org/"><%version%></generator> | |
22 | - <updated><%blog(feeds/atom/modified,1)%></updated> | |
23 | - | |
17 | + <generator url="http://nucleuscms.org/"><%version%></generator> | |
18 | + <modified><%blog(feeds/atom/modified,1)%></modified> | |
24 | 19 | <%blog(feeds/atom/entries,10)%> |
25 | 20 | </feed>]]></part> |
26 | 21 | </skin> |
@@ -35,14 +30,14 @@ | ||
35 | 30 | <template name="feeds/atom/entries"> |
36 | 31 | <description>Atom feeds: Feed items</description> |
37 | 32 | <part name="ITEM"><![CDATA[<entry> |
38 | - <title type="html"><![CDATA[<%title%>]]]]><![CDATA[></title> | |
33 | + <title type="text/html" mode="escaped"><![CDATA[<%title%>]]]]><![CDATA[></title> | |
39 | 34 | <link rel="alternate" type="text/html" href="<%blogurl%>?itemid=<%itemid%>" /> |
40 | 35 | <author> |
41 | 36 | <name><%author%></name> |
42 | 37 | </author> |
43 | - <updated><%date(utc)%></updated> | |
44 | - <published><%date(iso8601)%></published> | |
45 | - <content type="html"><![CDATA[<%body%><%more%>]]]]><![CDATA[></content> | |
38 | + <modified><%date(utc)%></modified> | |
39 | + <issued><%date(iso8601)%></issued> | |
40 | + <content type="text/html" mode="escaped"><![CDATA[<%body%><%more%>]]]]><![CDATA[></content> | |
46 | 41 | <id><%blogurl%>:<%blogid%>:<%itemid%></id> |
47 | 42 | </entry>]]></part> |
48 | 43 | <part name="IMAGE_CODE"><![CDATA[<%image%>]]></part> |
@@ -355,7 +355,6 @@ a:hover, a:active | ||
355 | 355 | } |
356 | 356 | .formfield |
357 | 357 | { |
358 | - display:block; | |
359 | 358 | font-size: 11px; |
360 | 359 | background: white; |
361 | 360 | color: #494949; |
@@ -376,9 +375,6 @@ a:hover, a:active | ||
376 | 375 | border-right: 1px solid #868686; |
377 | 376 | margin: 1px 0 0 0; |
378 | 377 | } |
379 | -.commentform .formfield, .commentform .formbutton, .loginform .formbutton { | |
380 | - display: block; | |
381 | -} | |
382 | 378 | .searchform .formfield |
383 | 379 | { |
384 | 380 | width: 130px; |
@@ -418,7 +414,7 @@ a:hover, a:active | ||
418 | 414 | font-family: Tahoma, Arial, Trebuchet MS, Verdana, sans-serif; |
419 | 415 | padding: 2px 2px; |
420 | 416 | } |
421 | -#nucleus_cf_name, #nucleus_cf_mail, #nucleus_cf_email | |
417 | +#nucleus_cf_name, #nucleus_cf_mail | |
422 | 418 | { |
423 | 419 | width: 300px; |
424 | 420 | margin-right: 105px; |
@@ -355,7 +355,6 @@ a:hover, a:active | ||
355 | 355 | } |
356 | 356 | .formfield |
357 | 357 | { |
358 | - display:block; | |
359 | 358 | font-size: 11px; |
360 | 359 | background: white; |
361 | 360 | color: #494949; |
@@ -376,9 +375,6 @@ a:hover, a:active | ||
376 | 375 | border-right: 1px solid #868686; |
377 | 376 | margin: 1px 0 0 0; |
378 | 377 | } |
379 | -.commentform .formfield, .commentform .formbutton, .loginform .formbutton { | |
380 | - display: block; | |
381 | -} | |
382 | 378 | .searchform .formfield |
383 | 379 | { |
384 | 380 | width: 130px; |
@@ -418,7 +414,7 @@ a:hover, a:active | ||
418 | 414 | font-family: Tahoma, Arial, Trebuchet MS, Verdana, sans-serif; |
419 | 415 | padding: 2px 2px; |
420 | 416 | } |
421 | -#nucleus_cf_name, #nucleus_cf_mail, #nucleus_cf_email | |
417 | +#nucleus_cf_name, #nucleus_cf_mail | |
422 | 418 | { |
423 | 419 | width: 300px; |
424 | 420 | margin-right: 105px; |
@@ -7,8 +7,8 @@ | ||
7 | 7 | |
8 | 8 | <!-- meta information for search engines --> |
9 | 9 | <meta name="generator" content="<%version%>" /> |
10 | -<meta name="name" content="<%if(skintype,error)%><%sitevar(name)%><%else%><%blogsetting(name)%><%endif%>" /> | |
11 | -<meta name="description" content="<%if(skintype,error)%><%sitevar(name)%><%else%><%blogsetting(desc)%><%endif%>" /> | |
10 | +<meta name="name" content="<%blogsetting(name)%>" /> | |
11 | +<meta name="description" content="<%blogsetting(desc)%>" /> | |
12 | 12 | |
13 | 13 | <!-- prevent caching (can be removed) --> |
14 | 14 | <meta http-equiv="Pragma" content="no-cache" /> |
@@ -53,4 +53,4 @@ | ||
53 | 53 | <link rel="top" title="Today" href="<%sitevar(url)%>" /> |
54 | 54 | <link rel="up" href="<%todaylink%>" title="Today" /> |
55 | 55 | <%endif%> |
56 | -</head> | |
\ No newline at end of file | ||
56 | +</head> |
@@ -5,16 +5,8 @@ | ||
5 | 5 | |
6 | 6 | <!-- archive: navigation --> |
7 | 7 | <%if(skintype,archive)%> |
8 | -<%if(archiveprevexists)%> | |
9 | 8 | <dd><a href="<%prevlink%>" title="Previous month">Previous <%archivetype%></a></dd> |
10 | -<%else%> | |
11 | -<dd> </dd> | |
12 | -<%endif%> | |
13 | -<%if(archivenextexists)%> | |
14 | 9 | <dd><a href="<%nextlink%>" title="Next month">Next <%archivetype%></a></dd> |
15 | -<%else%> | |
16 | -<dd> </dd> | |
17 | -<%endif%> | |
18 | 10 | <dd><a href="<%todaylink%>" title="Today's entry">Today</a></dd> |
19 | 11 | <dd><a href="<%archivelink%>" title="Archives">Archives</a></dd> |
20 | 12 | <%endif%> |
@@ -73,14 +65,6 @@ | ||
73 | 65 | </div> |
74 | 66 | <%endif%><%endif%> |
75 | 67 | |
76 | -<!-- bloglist--> | |
77 | -<div class="sidebar"> | |
78 | -<dl class="sidebardl"> | |
79 | -<dt>Blogs</dt> | |
80 | -<%bloglist(default/index)%> | |
81 | -</dl> | |
82 | -</div> | |
83 | - | |
84 | 68 | <!-- search form --> |
85 | 69 | <div class="sidebar"> |
86 | 70 | <dl class="sidebardl"> |
@@ -228,10 +228,6 @@ Website: <a href="<%member(url)%>"><%member(url)%></a> | ||
228 | 228 | <a href="<%archivelink%>" title="Archive for %B, %Y">%B, %Y</a> |
229 | 229 | </dd>]]></part> |
230 | 230 | |
231 | - <part name="BLOGLIST_LISTITEM"><![CDATA[<dd> | |
232 | -<a href="<%bloglink%>" title="<%blogdesc%>"><%blogname%></a> | |
233 | -</dd>]]></part> | |
234 | - | |
235 | 231 | <part name="CATLIST_HEADER"><![CDATA[<dd> |
236 | 232 | <a href="<%blogurl%>" title="All categories">All</a> |
237 | 233 | </dd>]]></part> |
@@ -1,48 +1,47 @@ | ||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /* |
4 | - * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
5 | - * Copyright (C) 2002-2007 The Nucleus Group | |
6 | - * | |
7 | - * This program is free software; you can redistribute it and/or | |
8 | - * modify it under the terms of the GNU General Public License | |
9 | - * as published by the Free Software Foundation; either version 2 | |
10 | - * of the License, or (at your option) any later version. | |
11 | - * (see nucleus/documentation/index.html#license for more info) | |
4 | + * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/) | |
5 | + * Copyright (C) 2002-2005 The Nucleus Group | |
6 | + * | |
7 | + * This program is free software; you can redistribute it and/or | |
8 | + * modify it under the terms of the GNU General Public License | |
9 | + * as published by the Free Software Foundation; either version 2 | |
10 | + * of the License, or (at your option) any later version. | |
11 | + * (see nucleus/documentation/index.html#license for more info) | |
12 | 12 | */ |
13 | 13 | |
14 | 14 | /** |
15 | - * Nucleus RSS syndication channel skin | |
15 | + * Nucleus RSS syndication channel skin | |
16 | 16 | * @license http://nucleuscms.org/license.txt GNU General Public License |
17 | - * @copyright Copyright (C) 2002-2007 The Nucleus Group | |
18 | - * @version $Id: xml-rss2.php,v 1.4.2.2 2007-03-27 11:26:50 kimitake Exp $ | |
19 | - * $NucleusJP: xml-rss2.php,v 1.8 2007/02/04 06:28:44 kimitake Exp $ | |
20 | - */ | |
17 | + * @copyright Copyright (C) 2002-2005 The Nucleus Group | |
18 | + * @version $Id: xml-rss2.php,v 1.4.2.3 2007-03-27 11:46:50 kimitake Exp $ | |
19 | + * @version $NucleusJP: xml-rss2.php,v 1.4.2.1 2005/08/23 08:08:37 kimitake Exp $ | |
20 | + */ | |
21 | 21 | |
22 | -header('Pragma: no-cache'); | |
22 | +header("Pragma: no-cache"); | |
23 | 23 | |
24 | 24 | $CONF = array(); |
25 | -$CONF['Self'] = 'xml-rss2.php'; | |
25 | +$CONF['Self'] = "xml-rss2.php"; | |
26 | 26 | |
27 | 27 | include('./config.php'); |
28 | 28 | |
29 | 29 | if (!$CONF['DisableSite']) { |
30 | - | |
31 | 30 | // get feed into $feed |
32 | 31 | ob_start(); |
33 | - selectSkin('feeds/rss20'); | |
34 | - selector(); | |
32 | + selectSkin('feeds/rss20'); | |
33 | + selector(); | |
35 | 34 | $feed = ob_get_contents(); |
36 | 35 | ob_end_clean(); |
37 | - | |
36 | + | |
38 | 37 | // create ETAG (hash of feed) |
39 | 38 | // (HTTP_IF_NONE_MATCH has quotes around it) |
40 | - $eTag = '"' . md5($feed) . '"'; | |
41 | - header('Etag: ' . $eTag); | |
42 | - | |
39 | + $eTag = '"'.md5($feed).'"'; | |
40 | + header('Etag: '.$eTag); | |
41 | + | |
43 | 42 | // compare Etag to what we got |
44 | - if ($eTag == serverVar('HTTP_IF_NONE_MATCH') ) { | |
45 | - header('HTTP/1.0 304 Not Modified'); | |
43 | + if ($eTag == serverVar('HTTP_IF_NONE_MATCH')) { | |
44 | + header("HTTP/1.0 304 Not Modified"); | |
46 | 45 | header('Content-Length: 0'); |
47 | 46 | } else { |
48 | 47 | $feed = mb_convert_encoding($feed, "UTF-8", "EUC-JP"); |
@@ -50,23 +49,23 @@ if (!$CONF['DisableSite']) { | ||
50 | 49 | // dump feed |
51 | 50 | echo $feed; |
52 | 51 | } |
53 | - | |
52 | + | |
54 | 53 | } else { |
55 | 54 | // output empty RSS file... |
56 | 55 | // (because site is disabled) |
57 | - | |
58 | - echo '<' . '?xml version="1.0" encoding="' . _CHARSET . '"?' . '>'; | |
59 | - | |
56 | + | |
57 | + echo '<' . '?xml version="1.0" encoding="ISO-8859-1"?' . '>'; | |
58 | + | |
60 | 59 | ?> |
61 | 60 | <rss version="2.0"> |
62 | - <channel> | |
63 | - <title><?php echo htmlspecialchars($CONF['SiteName']); ?></title> | |
64 | - <link><?php echo htmlspecialchars($CONF['IndexURL']); ?></link> | |
65 | - <description></description> | |
66 | - <docs>http://backend.userland.com/rss</docs> | |
67 | - </channel> | |
68 | - </rss> | |
61 | + <channel> | |
62 | + <title><?php echo htmlspecialchars($CONF['SiteName'])?></title> | |
63 | + <link><?php echo htmlspecialchars($CONF['IndexURL'])?></link> | |
64 | + <description></description> | |
65 | + <docs>http://backend.userland.com/rss</docs> | |
66 | + </channel> | |
67 | + </rss> | |
69 | 68 | <?php |
70 | 69 | } |
71 | 70 | |
72 | -?> | |
\ No newline at end of file | ||
71 | +?> |