OSDN Git Service

merged from v3.31sp1
authorkimitake <kimitake@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Fri, 8 Feb 2008 09:31:23 +0000 (09:31 +0000)
committerkimitake <kimitake@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Fri, 8 Feb 2008 09:31:23 +0000 (09:31 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk@371 1ca29b6e-896d-4ea0-84a5-967f57386b96

60 files changed:
utf8/action.php
utf8/createaccount.php [new file with mode: 0644]
utf8/install.sql
utf8/nucleus/bookmarklet.php
utf8/nucleus/forgotpassword.html
utf8/nucleus/index.php
utf8/nucleus/javascript/admin.js
utf8/nucleus/language/english.php
utf8/nucleus/language/japanese-utf8.php
utf8/nucleus/libs/ACTION.php
utf8/nucleus/libs/ADMIN.php
utf8/nucleus/libs/BLOG.php
utf8/nucleus/libs/BODYACTIONS.php
utf8/nucleus/libs/COMMENTACTIONS.php
utf8/nucleus/libs/COMMENTS.php
utf8/nucleus/libs/ENCAPSULATE.php
utf8/nucleus/libs/ITEM.php
utf8/nucleus/libs/ITEMACTIONS.php
utf8/nucleus/libs/MANAGER.php
utf8/nucleus/libs/PAGEFACTORY.php
utf8/nucleus/libs/PARSER.php
utf8/nucleus/libs/PLUGIN.php
utf8/nucleus/libs/PLUGINADMIN.php
utf8/nucleus/libs/SKIN.php
utf8/nucleus/libs/backup.php
utf8/nucleus/libs/globalfunctions.php
utf8/nucleus/libs/showlist.php
utf8/nucleus/libs/skinie.php
utf8/nucleus/libs/vars4.0.6.php
utf8/nucleus/libs/vars4.1.0.php
utf8/nucleus/libs/xmlrpc.inc.php
utf8/nucleus/libs/xmlrpcs.inc.php
utf8/nucleus/media.php
utf8/nucleus/plugins/NP_Ping.php [new file with mode: 0644]
utf8/nucleus/plugins/NP_SkinFiles.php
utf8/nucleus/plugins/ping/english.php [new file with mode: 0644]
utf8/nucleus/plugins/ping/japanese-euc.php [new file with mode: 0644]
utf8/nucleus/plugins/ping/japanese-utf8.php [new file with mode: 0644]
utf8/nucleus/plugins/ping/ping.php [new file with mode: 0644]
utf8/nucleus/plugins/skinfiles/english.php
utf8/nucleus/plugins/skinfiles/index.php
utf8/nucleus/plugins/skinfiles/japanese-euc.php
utf8/nucleus/plugins/skinfiles/japanese-utf8.php
utf8/nucleus/styles/bookmarklet.css
utf8/nucleus/upgrades/index.php
utf8/nucleus/upgrades/upgrade.functions.php
utf8/nucleus/upgrades/upgrade.php
utf8/nucleus/upgrades/upgrade0.95.php
utf8/nucleus/upgrades/upgrade0.96.php
utf8/nucleus/upgrades/upgrade1.0.php
utf8/nucleus/upgrades/upgrade1.1.php
utf8/nucleus/upgrades/upgrade1.5.php
utf8/nucleus/upgrades/upgrade2.0.php
utf8/nucleus/upgrades/upgrade2.5.php
utf8/nucleus/upgrades/upgrade3.0.php
utf8/nucleus/upgrades/upgrade3.1.php
utf8/nucleus/upgrades/upgrade3.2.php
utf8/nucleus/upgrades/upgrade3.3.php
utf8/nucleus/upgrades/upgrade3.31.php [new file with mode: 0644]
utf8/nucleus/xmlrpc/server.php

index acdab03..60fa8cd 100755 (executable)
@@ -15,8 +15,8 @@
  * like adding comments, etc...
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  * like adding comments, etc...
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: action.php,v 1.8 2007-03-27 21:59:40 kmorimatsu Exp $
- * $NucleusJP: action.php,v 1.7 2007/02/04 06:28:44 kimitake Exp $
+ * @version $Id: action.php,v 1.9 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: action.php,v 1.8.2.1 2007/09/05 05:50:12 kimitake Exp $
  */
 
 $CONF = array();
  */
 
 $CONF = array();
diff --git a/utf8/createaccount.php b/utf8/createaccount.php
new file mode 100644 (file)
index 0000000..78bbbc1
--- /dev/null
@@ -0,0 +1,129 @@
+<?php
+       require "./config.php";
+       include $DIR_LIBS."ACTION.php";
+       
+       if (isset ($_POST['showform'])&&$_POST['showform']==1) {
+               $showform = 1;
+       }
+       else {
+               $showform = 0;
+       }
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja-JP" lang="ja-JP">
+<head>
+       <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET; ?>" />
+       <title>Create Member Account</title>
+       <style type="text/css">@import url(nucleus/styles/manual.css);</style>
+</head>
+<body>
+
+       <h1><?php echo _CREATE_ACCOUNT0?></h1>
+
+<?php
+       // show form only if Visitors are allowed to create a Member Account
+       if ($CONF['AllowMemberCreate']==1) { 
+               // if the form is shown the first time no POST data 
+               // will be added as value for the input fields
+               if ($showform==0) {
+?>
+
+       <form method="post" action="createaccount.php">
+
+       <div>
+       <input type="hidden" name="showform" value="1" />
+       <input type="hidden" name="action" value="createaccount" />
+       
+               <?php echo _CREATE_ACCOUNT_LOGIN_NAME?>
+               <br />
+               <input name="name" size="20" /> <small>(only a-z, 0-9)</small>
+               <br />
+               <br />          
+               <?php echo _CREATE_ACCOUNT_REAL_NAME?>
+               <br />
+               <input name="realname" size="40" />
+               <br />
+               <br />          
+               <?php echo _CREATE_ACCOUNT_EMAIL?>
+               <br />
+               <input name="email" size="40" /> <small><?php echo _CREATE_ACCOUNT_EMAIL2?></small>
+               <br />
+               <br />          
+               <?php echo _CREATE_ACCOUNT_URL?>
+               <br />
+               <input name="url" size="60" />
+               <br />
+               <?php
+               // add a Captcha challenge or something else
+               global $manager;
+               $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
+               ?>
+               <br />
+               <br />                                          
+               <input type="submit" value="<?php echo _CREATE_ACCOUNT_SUBMIT?>" />
+       </div>
+
+       </form>
+<?php
+               } // close if showfrom ...
+               else {
+               // after the from is sent it will be validated
+               // POST data will be added as value to treat the user with care (;-))
+       
+               $a = new ACTION();
+
+               // if createAccount fails it returns an error message 
+               $message = $a->createAccount();
+
+               echo '<span style="font-weight:bold; color:red;">'.htmlspecialchars($message).'</span><br /><br />'; 
+?>
+       
+               <form method="post" action="createaccount.php">
+
+       <div>
+       <input type="hidden" name="showform" value="1" />
+       <input type="hidden" name="action" value="createaccount" />
+       
+               <?php echo _CREATE_ACCOUNT_LOGIN_NAME?> 
+               <br />
+               <input name="name" size="20" <?php if(isset($_POST['name'])){echo 'value="'.htmlspecialchars($_POST['name']).'"';}?>/> <small>(only a-z, 0-9)</small>
+               <br />
+               <br />          
+               <?php echo _CREATE_ACCOUNT_REAL_NAME?> 
+               <br />
+               <input name="realname" size="40" <?php if(isset($_POST['realname'])){echo 'value="'.htmlspecialchars($_POST['realname']).'"';}?>/>
+               <br />
+               <br />          
+               <?php echo _CREATE_ACCOUNT_EMAIL?>
+               <br />
+               <input name="email" size="40" <?php if(isset($_POST['email'])){echo 'value="'.htmlspecialchars($_POST['email']).'"';}?>/> <small><?php echo _CREATE_ACCOUNT_EMAIL2?></small>
+               <br />
+               <br />          
+               <?php echo _CREATE_ACCOUNT_URL?> 
+               <br />
+               <input name="url" size="60" <?php if(isset($_POST['url'])){echo 'value="'.htmlspecialchars($_POST['url']).'"';}?>/>
+               <br />
+               <?php
+               // add a Captcha challenge or something else
+               global $manager;
+               $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
+               ?>
+               <br />
+               <br />
+               <input type="submit" value="<?php echo _CREATE_ACCOUNT_SUBMIT?>" />
+
+
+       </form>
+<?php
+               }       // close else showform ...
+
+}
+else { 
+       echo _CREATE_ACCOUNT1;
+       echo _CREATE_ACCOUNT2;
+}
+?>
+       
+       
+</body>
+</html>
index cff9090..4c812fe 100755 (executable)
@@ -38,12 +38,13 @@ CREATE TABLE `nucleus_blog` (
   `ballowpast` tinyint(2) NOT NULL default '0',
   `bincludesearch` tinyint(2) NOT NULL default '0',
   `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL,
   `ballowpast` tinyint(2) NOT NULL default '0',
   `bincludesearch` tinyint(2) NOT NULL default '0',
   `breqemail` TINYINT( 2 ) DEFAULT '0' NOT NULL,
+  `bfuturepost` TINYINT(2) DEFAULT '0' NOT NULL,
   PRIMARY KEY  (`bnumber`),
   UNIQUE KEY `bnumber` (`bnumber`),
   UNIQUE KEY `bshortname` (`bshortname`)
 ) TYPE=MyISAM;
 
   PRIMARY KEY  (`bnumber`),
   UNIQUE KEY `bnumber` (`bnumber`),
   UNIQUE KEY `bshortname` (`bshortname`)
 ) TYPE=MyISAM;
 
-INSERT INTO `nucleus_blog` VALUES (1, 'My Nucleus CMS', 'mynucleuscms', '', 1, 0, 0.0, '', 'http://localhost:8080/nucleus/', '', 5, 1, 0, 1, 1, 1, 1, 0, 0);
+INSERT INTO `nucleus_blog` VALUES (1, 'My Nucleus CMS', 'mynucleuscms', '', 1, 0, 0.0, '', 'http://localhost:8080/nucleus/', '', 5, 1, 0, 1, 1, 1, 1, 0, 0, 0);
 
 CREATE TABLE `nucleus_category` (
   `catid` int(11) NOT NULL auto_increment,
 
 CREATE TABLE `nucleus_category` (
   `catid` int(11) NOT NULL auto_increment,
@@ -125,15 +126,199 @@ CREATE TABLE `nucleus_item` (
   `ikarmapos` int(11) NOT NULL default '0',
   `icat` int(11) default NULL,
   `ikarmaneg` int(11) NOT NULL default '0',
   `ikarmapos` int(11) NOT NULL default '0',
   `icat` int(11) default NULL,
   `ikarmaneg` int(11) NOT NULL default '0',
+  `iposted` tinyint(2) NOT NULL default '1',
   PRIMARY KEY  (`inumber`),
   UNIQUE KEY `inumber` (`inumber`),
   KEY `itime` (`itime`),
   FULLTEXT KEY `ibody` (`ibody`,`ititle`,`imore`)
 ) TYPE=MyISAM PACK_KEYS=0;
 
   PRIMARY KEY  (`inumber`),
   UNIQUE KEY `inumber` (`inumber`),
   KEY `itime` (`itime`),
   FULLTEXT KEY `ibody` (`ibody`,`ititle`,`imore`)
 ) TYPE=MyISAM PACK_KEYS=0;
 
-INSERT INTO `nucleus_item` VALUES (1, 'Nucleus CMS バージョン3.3へようこそ',
-'ウェブページの作成を補助する積み木がここにあります。それは心躍るblogになるかもしれませんし、観るものを和ませる家族のページになるかもしれませんし、実り多き趣味のサイトになるかもしれません。あるいは現在のあなたには想像がつかないものになることだってあるでしょう。<br />\r\n<br />\r\n用途が思いつきませんでしたか? それならここへ来て正解です。なぜならあなた同様私たちにもわからないのですから。',
-'これはサイトにおける最初のエントリーです。スタートを切りやすいように、リンクと情報を入れておきました。<br />\r\n<br />\r\nこの記事を削除することもできますが、どちらにせよ記事を追加していくことによってやがてメインページからは見えなくなります。Nucleusを扱ううちに生じたメモをコメントとして追加し、将来アクセスできるようにこのページをブックマークしておくのも手です。<br />\r\n<br />\r\n<b>リンク</b><br />\r\n<br />\r\nNucleus CMSの<a href="http://nucleuscms.org">本家</a>と<a href="http://japan.nucleuscms.org">日本語公式</a>ページ。<br />\r\n<br />\r\nNucleus CMSのSourceForge<a href="http://sourceforge.net/projects/nucleuscms/">プロジェクト</a>(<a href="http://sourceforge.jp/projects/nucleus-jp/">日本版</a>)ページ。<br />\r\n<br />\r\nNucleus CMSのプラグイン<a href="http://wakka.xiffy.nl/Plugin/">倉庫</a>と<a href="http://japan.nucleuscms.org/wiki/plugins">日本語のリスト</a>ページ。<br />\r\n<br />\r\n<b>ドキュメント - <a href="http://docs.nucleuscms.org/">docs.nucleuscms.org</a></b><br />\r\n<br />\r\nNucleusの<a href="http://japan.nucleuscms.org/faq.php">FAQ(よくある質問集)</a>(<a href="http://nucleuscms.org/faq.php">原文</a>)ページ。<br />\r\n<br />\r\nインストール方法等は<a href="nucleus/documentation/">ユーザー向け</a>と<a href="nucleus/documentation/devdocs/">開発者向け</a>文書がファイルに含まれています。<br />\r\n<br />\r\nポップアップ<a href="./nucleus/documentation/help.html">ヘルプ</a>が管理エリアのいたるところにあり、サイトのカスタマイズやデザインを手助けしてくれることでしょう。<br />\r\n<br />\r\n一度用意されているドキュメントに目を通したら、<a href="http://wiki.nucleuscms.org/">Wiki</a>(<a href="http://japan.nucleuscms.org/wiki/">日本版</a>)を訪れてください。ユーザーの書いたハウツーや小技が掲載されています。<br />\r\n<br />\r\n<b>サポート</b><br />\r\n<br />\r\n<a href="http://forum.nucleuscms.org/">forum.nucleuscms.org</a>(本家)<br />\r\n<a href="http://japan.nucleuscms.org/bb/">japan.nucleuscms.org/bb/</a>(日本版)<br />\r\n<br />\r\n<a href="http://forum.nucleuscms.org/groupcp.php?g=3">moderators</a>とサポートフォーラムで活動する全てのボランティアに感謝します。<br />\r\n<br />\r\n- <a href="http://edmondhui.homeip.net/blog/">admun</a> - Ottawa, ON, Canada            <br />\r\n- <a href="http://www.tamizhan.com/">anand</a> - Bangalore, India<br />\r\n- <a href="http://hcgtv.com">hcgtv</a> - Miami, Florida, USA<br />\r\n- <a href="http://www.adrenalinsports.nl/">ikeizer</a> - Maastricht<br />\r\n- <a href="http://www.tipos.com.br/">moraes</a> - Brazil<br />\r\n- <a href="http://roelg.nl/">roel </a>- The Netherlands<br />\r\n- <a href="http://budts.be/weblog/">TeRanEX </a>- Ekeren, Antwerp, Belgium<br />\r\n- <a href="http://www.trentadams.com/">Trent </a>- Alberta, Canada<br />\r\n- <a href="http://xiffy.nl/weblog/">xiffy </a>- Deventer<br />\r\n<br />\r\nもし手助けが必要なら、1400を超える登録ユーザーのいる私たちのフォーラムに参加してください。23,000を超える投稿された記事を検索できるようになっておりますので、求める答えに数回のクリックでたどり着けるかもしれません。<br />\r\n<br />\r\n<b>Personalization - <a href="http://skins.nucleuscms.org/">skins.nucleuscms.org</a></b><br />\r\n<br />\r\nマルチウェブログとスキン/テンプレートの組み合わせは強力な相乗効果を生み出します。個人的なサイト作成、友人や親戚あるいはクライアントに対するサイトデザインいずれに対してもです。<br />\r\n<br />\r\n636の登録された<a href="http://nucleuscms.org/sites.php">Nucleusで運用されているサイト</a>(<a href="http://japan.nucleuscms.org/sites.php">日本版</a>)の中から特色あるサイトをサンプルとしてご紹介します。<br />\r\n<br />\r\nThe Zen of Nucleus<br />\r\n- <a href="http://beefcake.nl/">beefcake.nl</a> - Beefcake | Nuke the whales!<br />\r\n- <a href="http://www.leng-lui.com//">leng-lui.com</a> - Leng-Lui.com - v7.0: "Memento"<br />\r\n<br />\r\nPersonal blogs<br />\r\n- <a href="http://bloggard.com/">bloggard.com</a> - The Adventures of Bloggard<br />\r\n- <a href="http://battleangel.org/">battleangel.org</a> - Giving meaning to the meaningless<br />\r\n- <a href="http://www.yetanotherblog.de/">yetanotherblog.de</a> - Yet Another Blog<br />\r\n<br />\r\nMulti user blogs<br />\r\n- <a href="http://tipos.com.br/">tipos.com.br</a> - Blogging community<br />\r\n<br />\r\nHobby, Travel and News sites<br />\r\n- <a href="http://adrenalinsports.nl/">adrenalinsports.nl</a> - Extreme sports<br />\r\n- <a href="http://hsbluebird.com/">hsbluebird.com</a> - Hot Springs, Montana''s Online Resource <br />\r\n- <a href="http://groningen-info.de/">groningen-info.de</a> - Neues aus Groningen. Fr Leute aus Duitsland.<br />\r\n- <a href="http://www.americandaily.com/">americandaily.com</a> - American Daily - Home<br />\r\n<br />\r\n<b>Nucleus Developer Network - <a href="http://dev.nucleuscms.org/">dev.nucleuscms.org</a></b><br />\r\n<br />\r\nThe NUDN is a hub for developer sites and programming resources.<br />\r\n<br />\r\nNUDN satellite sites, handles, location and UTC offset:<br />\r\n- <a href="http://karma.nucleuscms.org/">karma</a> - Izegem +02<br />\r\n- <a href="http://hcgtv.net/">hcgtv</a> - Miami -05<br />\r\n- <a href="http://edmondhui.homeip.net/blog/nudn.php">admun</a> - Ottawa -04<br />\r\n- <a href="http://dev.budts.be/nucleus/">TeRanEX</a> - Ekeren +02<br />\r\n<br />\r\nSourceforge.net graciously hosts our <a href="http://sourceforge.net/projects/nucleuscms/">CVS repository</a>.<br />\r\n<br />\r\nWant to play around or test changes, visit our demo site at <a href="http://demo.nucleuscms.org/">demo.nucleuscms.org</a>.<br />\r\n<br />\r\nNot sure what plugins to use, visit the <a href="http://showcase.trentadams.com/">showcase site</a> where you can see plugins at play in their native habitat.<br />\r\n<br />\r\nThen visit the plugin repository at <a href="http://plugins.nucleuscms.org/">plugins.nucleuscms.org</a> for download and installation instructions.<br />\r\n<br />\r\n<b>寄付者一覧</b><br />\r\n<br />\r\n以下の<a href="http://nucleuscms.org/donators.php">素晴らしい人々</a>による<a href="http://nucleuscms.org/donate.php">援助</a>感謝を捧げます。<em>ありがとう!</em><br />\r\n<br />\r\n- <a href="http://reddustrec.net/">dkex</a><br />\r\n- <a href="http://www.uncoverthenet.com/">Uncover the Net</a><br />\r\n- <a href="http://www.webatlas.org/">Web Atlas</a><br />\r\n- <a href="http://www.ipnlighting.com/">IPN Lighting</a><br />\r\n- <a href="http://blog.datoka.jp/">Yu (blog.datoka.jp)</a><br />\r\n- <a href="http://www.thegadgetreview.com/">Sony Gadgets and Reviews</a><br />\r\n- <a href="http://sites.proliphus.com/blueZhift/blog/">Thomas McKibben</a><br />\r\n- <a href="http://cheapweb.us/">CheapWeb.us</a><br />\r\n- Robert Seyfriedsberger<br />\r\n- <a href="http://www.toxicologie.nl/">Toxicologie.nl</a><br />\r\n- Gordon Shum<br />\r\n- <a href="http://www.subsim.com/">Neal Stevens</a><br />\r\n- <a href="http://www.GamblingHelper.com/">GamblingHelper</a><br />\r\n- Oliver Kirstein<br />\r\n- <a href="http://www.dominiek.be/">Dominiek</a><br />\r\n- <a href="http://www.aardschok.net/">Aardschok</a><br />\r\n- <a href="http://www.nieuwevoordeur.be/">nieuwevoordeur.be</a><br />\r\n- <a href="http://www.scene24.net/">Scene24</a><br />\r\n- <a href="http://www.eug.be/">Eug''s Weblog</a><br />\r\n- <a href="http://www.bloggard.com/">The Adventures of Bloggard</a><br />\r\n- <a href="http://www.voltos.com/">Arthur Cronos from Voltos</a><br />\r\n- <a href="http://www.webmaster-toolkit.com/">Free Webmaster Tools and Resources</a><br />\r\n- <a href="http://www.domilog.be/">Domi''s Weblog</a><br />\r\n- Infodoma          <br />\r\n- <a href="http://carvingcode.com/">carvingCode.com</a><br />\r\n- <a href="http://www.traweb.com/">Traweb</a><br />\r\n- <a href="http://gene.mm2u.com/">Gene''s MoBlog</a><br />\r\n- <a href="http://interfacethis.com/">InterfaceThis</a><br />\r\n- <a href="http://www.thefinsters.com/flog/">The Finster Log</a><br />\r\n- <a href="http://www.mrhop.com/">Hop Nguyen</a><br />\r\n- <a href="http://www.zwavel.com/~zwavelaars" title="Zwavelaars">Zwavelaars</a><br />\r\n- <a href="http://beefcake.nl/">Joaquin Scholten</a>      <br />\r\n- <a href="http://www.roelgroeneveld.com/">Roel Groeneveld</a><br />\r\n- <a href="http://lvb.net/">LVBlog</a><br />\r\n- <a href="http://xandermol.com/">Xander Mol</a><br />\r\n- Danilo Massa<br />\r\n- <a href="http://01FTP.com/">01FTP.com</a><br />\r\n- <a href="http://www.adrenalinsports.nl/">Irmo Keizer</a><br />\r\n- <a href="http://www.jasonkrogh.com/">Jason Krogh</a><br />\r\n- <a href="http://www.higuchi.com/">Osamu Higuchi</a><br />\r\n- <a href="http://www.trentadams.com/">Trent Adams</a><br />\r\n- <a href="http://www.ppcw.net/">Arne Hess</a><br />\r\n- <a href="http://hsbluebird.com/">The Bluebird</a><br />\r\n- Rainer Bickel<br />\r\n- Fritz Elfers<br />\r\n- <a href="http://www.european-wall-tapestries.com/">European Wall Tapestries</a><br />\r\n- <a href="http://www.jamier.net/">Jamie R. Rytlewski</a><br />\r\n- Madolyn Piper<br />\r\n- <a href="http://www.batteryvalues.com/">Battery Values</a><br />\r\n- <a href="http://www.mixburnrip.de/">Janko Roettgers</a><br />\r\n- Lukas Loesche<br />\r\n- <a href="http://www.seobook.com/">SEO Book</a><br />\r\n- <a href="http://www.brandweerdematen.nl/">Brandweer de Maten</a><br />\r\n- Andy Fuchs<br />\r\n- <a href="http://www.sumoforce.com/">Sumoforce</a><br />\r\n- <a href="http://love.silverindigo.com/">Al''ky''mie</a><br />\r\n- <a href="http://www.pejo.us/">Peter Johnson</a><br />\r\n- <a href="http://www.triv.nl/">TriV Internet Solutions</a><br />\r\n- <a href="http://www.torontomusicians.org/nucleus/">Margaret Stowe</a><br />\r\n- <a href="http://www.zenkey.org/">zenkey dot org</a><br />\r\n- <a href="http://www.golb.org/">Blots of Info</a><br />\r\n- <a href="http://www.zonderpartij.be/">Rudi De Kerpel</a><br />\r\n- <a href="http://staylorx.com/">Steve Taylor</a><br />\r\n- <a href="http://lmhcave.com/">Malcolm Farnsworth</a><br />\r\n- Birgit Kellner<br />\r\n- <a href="http://www.tobiasly.com/">Toby Johnson</a><br />\r\n- <a href="http://www.kapingamarangi.be/">Kapingamarangi</a><br />\r\n- <a href="http://www.pallalink.net/">Pallalink</a><br />\r\n- <a href="http://publiustx.net/">PubliusTX Weblog</a><br />\r\n- <a href="http://www.reductioadabsurdum.net/">Reductio Ad Absurdum</a><br />\r\n- <a href="http://www.gagaweb.org/">GagaWeb</a><br />\r\n- <a href="http://www.videokid.be/">Videokid</a><br />\r\n- Jon Marr<br />\r\n- <a href="http://www.docblog.org/">Luigi Cristiano</a><br />\r\n- J Keith Lehman<br />\r\n- Bohemian Cachet<br />\r\n- Jesus Mourazos<br />\r\n- <a href="http://ltp-design.com/">Stephen Jones</a><br />\r\n- <a href="http://oha.nu/">One-Handed Apps</a><br />\r\n- Alwin Hawkins<br />\r\n- <a href="http://jstigall.bloomington.in.us">Justin Stigall</a><br />\r\n- <a href="http://www.itismylife.com/">It is my life</a><br />\r\n- Greg Morrill<br />\r\n- <a href="http://www.dutchsubmarines.com/">Dutch Submarines</a><br />\r\n- <a href="http://www.7thwatch.com/">Seventh Watch Design Studios</a>                <br />\r\n- <a href="http://www.macnet2.com/">MacNetv2</a>      <br />\r\n- Richard Noordhof<br />\r\n- <a href="http://www.jamier.net/">Jamie Rytlewski</a><br />\r\n<br />\r\nNucleusが気に入りましたか? <a href="http://www.hotscripts.com/Detailed/13368.html?RID=nucleus@demuynck.org">HotScripts</a>や<a href="http://www.opensourcecms.com/index.php?option=content&task=view&id=145">opensourceCMS</a>での投票をお願いします。<br />\r\n<br />\r\n<b>ライセンス</b><br />\r\n<br />\r\n私たちがフリー・ソフトウェアについて口にする場合は自由のことに言及しているのであって、価格のことではありません。私たちの<a href="http://www.gnu.org/licenses/gpl.html">一般公有使用許諾書</a>(<a href="http://www.gnu.org/licenses/gpl.ja.html">日本語訳</a>と<a href="http://www.atmarkit.co.jp/aig/03linux/gpl.html">概要</a>)は、フリー・ソフトウェアの複製物を自由に頒布できること(そして、望むならこのサービスに対して対価を請求できること)、ソース・コードを実際に受け取るか希望しさえすれば入手することが可能であること、入手したソフトウェアを変更したり新しいフリー・プログラムの一部として使用できること、以上の各内容を行なうことができるということをユーザ自身が知っていることを実現できるようにデザインされています。', 1, 1, '2005-02-16 22:57:54', 0, 0, 0, 1, 0);
+INSERT INTO `nucleus_item` VALUES (1, 'Nucleus CMS バージョン3.31へようこそ',
+'ウェブページの作成を補助する積み木がここにあります。それは心躍るblogになるかもしれませんし、観るものを和ませる家族のページになるかもしれませんし、実り多き趣味のサイトになるかもしれません。あるいは現在のあなたには想像がつかないものになることだってあるでしょう。<br />
+<br />
+用途が思いつきませんでしたか? それならここへ来て正解です。なぜならあなた同様私たちにもわからないのですから。',
+'これはサイトにおける最初のエントリーです。スタートを切りやすいように、リンクと情報を入れておきました。<br />
+<br />
+この記事を削除することもできますが、どちらにせよ記事を追加していくことによってやがてメインページからは見えなくなります。Nucleusを扱ううちに生じたメモをコメントとして追加し、将来アクセスできるようにこのページをブックマークしておくのも手です。<br />
+<br />
+<b>リンク</b><br />
+<br />
+Nucleus CMSの<a href="http://nucleuscms.org">本家</a>と<a href="http://japan.nucleuscms.org">日本語公式</a>ページ。<br />
+<br />
+Nucleus CMSのSourceForge<a href="http://sourceforge.net/projects/nucleuscms/">プロジェクト</a>(<a href="http://sourceforge.jp/projects/nucleus-jp/">日本版</a>)ページ。<br />
+<br />
+Nucleus CMSのプラグイン<a href="http://wakka.xiffy.nl/Plugin/">倉庫</a>と<a href="http://japan.nucleuscms.org/wiki/plugins">日本語のリスト</a>ページ。<br />
+<br />
+<b>ドキュメント - <a href="http://docs.nucleuscms.org/">docs.nucleuscms.org</a></b><br />
+<br />
+Nucleusの<a href="http://japan.nucleuscms.org/faq.php">FAQ(よくある質問集)</a>(<a href="http://nucleuscms.org/faq.php">原文</a>)ページ。<br />
+<br />
+インストール方法等は<a href="nucleus/documentation/">ユーザー向け</a>と<a href="nucleus/documentation/devdocs/">開発者向け</a>文書がファイルに含まれています。<br />
+<br />
+ポップアップ<a href="./nucleus/documentation/help.html">ヘルプ</a>が管理エリアのいたるところにあり、サイトのカスタマイズやデザインを手助けしてくれることでしょう。<br />
+<br />
+一度用意されているドキュメントに目を通したら、<a href="http://wiki.nucleuscms.org/">Wiki</a>(<a href="http://japan.nucleuscms.org/wiki/">日本版</a>)を訪れてください。ユーザーの書いたハウツーや小技が掲載されています。<br />
+<br />
+<b>サポート</b><br />
+<br />
+<a href="http://forum.nucleuscms.org/">forum.nucleuscms.org</a>(本家)<br />
+<a href="http://japan.nucleuscms.org/bb/">japan.nucleuscms.org/bb/</a>(日本版)<br />
+<br />
+<a href="http://forum.nucleuscms.org/groupcp.php?g=3">moderators</a>とサポートフォーラムで活動する全てのボランティアに感謝します。<br />
+<br />
+- <a href="http://edmondhui.homeip.net/blog/">admun</a> - Ottawa, ON, Canada           <br />
+- <a href="http://www.tamizhan.com/">anand</a> - Bangalore, India<br />
+- <a href="http://hcgtv.com">hcgtv</a> - Miami, Florida, USA<br />
+- <a href="http://www.adrenalinsports.nl/">ikeizer</a> - Maastricht<br />
+- <a href="http://www.tipos.com.br/">moraes</a> - Brazil<br />
+- <a href="http://roelg.nl/">roel </a>- The Netherlands<br />
+- <a href="http://budts.be/weblog/">TeRanEX </a>- Ekeren, Antwerp, Belgium<br />
+- <a href="http://www.trentadams.com/">Trent </a>- Alberta, Canada<br />
+- <a href="http://xiffy.nl/weblog/">xiffy </a>- Deventer<br />
+<br />
+もし手助けが必要なら、1400を超える登録ユーザーのいる私たちのフォーラムに参加してください。23,000を超える投稿された記事を検索できるようになっておりますので、求める答えに数回のクリックでたどり着けるかもしれません。<br />
+<br />
+<b>Personalization - <a href="http://skins.nucleuscms.org/">skins.nucleuscms.org</a></b><br />
+<br />
+マルチウェブログとスキン/テンプレートの組み合わせは強力な相乗効果を生み出します。個人的なサイト作成、友人や親戚あるいはクライアントに対するサイトデザインいずれに対してもです。<br />
+<br />
+636の登録された<a href="http://nucleuscms.org/sites.php">Nucleusで運用されているサイト</a>(<a href="http://japan.nucleuscms.org/sites.php">日本版</a>)の中から特色あるサイトをサンプルとしてご紹介します。<br />
+<br />
+The Zen of Nucleus<br />
+- <a href="http://beefcake.nl/">beefcake.nl</a> - Beefcake | Nuke the whales!<br />
+- <a href="http://www.leng-lui.com//">leng-lui.com</a> - Leng-Lui.com - v7.0: "Memento"<br />
+<br />
+Personal blogs<br />
+- <a href="http://bloggard.com/">bloggard.com</a> - The Adventures of Bloggard<br />
+- <a href="http://battleangel.org/">battleangel.org</a> - Giving meaning to the meaningless<br />
+- <a href="http://www.yetanotherblog.de/">yetanotherblog.de</a> - Yet Another Blog<br />
+<br />
+Multi user blogs<br />
+- <a href="http://tipos.com.br/">tipos.com.br</a> - Blogging community<br />
+<br />
+Hobby, Travel and News sites<br />
+- <a href="http://adrenalinsports.nl/">adrenalinsports.nl</a> - Extreme sports<br />
+- <a href="http://hsbluebird.com/">hsbluebird.com</a> - Hot Springs, Montana''s Online Resource <br />
+- <a href="http://groningen-info.de/">groningen-info.de</a> - Neues aus Groningen. Fr Leute aus Duitsland.<br />
+- <a href="http://www.americandaily.com/">americandaily.com</a> - American Daily - Home<br />
+<br />
+<b>Nucleus Developer Network - <a href="http://dev.nucleuscms.org/">dev.nucleuscms.org</a></b><br />
+<br />
+The NUDN is a hub for developer sites and programming resources.<br />
+<br />
+NUDN satellite sites, handles, location and UTC offset:<br />
+- <a href="http://karma.nucleuscms.org/">karma</a> - Izegem +02<br />
+- <a href="http://hcgtv.net/">hcgtv</a> - Miami -05<br />
+- <a href="http://edmondhui.homeip.net/blog/nudn.php">admun</a> - Ottawa -04<br />
+- <a href="http://dev.budts.be/nucleus/">TeRanEX</a> - Ekeren +02<br />
+<br />
+Sourceforge.net graciously hosts our <a href="http://sourceforge.net/projects/nucleuscms/">CVS repository</a>.<br />
+<br />
+Want to play around or test changes, visit our demo site at <a href="http://demo.nucleuscms.org/">demo.nucleuscms.org</a>.<br />
+<br />
+Not sure what plugins to use, visit the <a href="http://showcase.trentadams.com/">showcase site</a> where you can see plugins at play in their native habitat.<br />
+<br />
+Then visit the plugin repository at <a href="http://plugins.nucleuscms.org/">plugins.nucleuscms.org</a> for download and installation instructions.<br />
+<br />
+<b>寄付者一覧</b><br />
+<br />
+以下の<a href="http://nucleuscms.org/donators.php">素晴らしい人々</a>による<a href="http://nucleuscms.org/donate.php">援助</a>感謝を捧げます。<em>ありがとう!</em><br />
+<br />
+- <a href="http://reddustrec.net/">dkex</a><br />
+- <a href="http://www.uncoverthenet.com/">Uncover the Net</a><br />
+- <a href="http://www.webatlas.org/">Web Atlas</a><br />
+- <a href="http://www.ipnlighting.com/">IPN Lighting</a><br />
+- <a href="http://blog.datoka.jp/">Yu (blog.datoka.jp)</a><br />
+- <a href="http://www.thegadgetreview.com/">Sony Gadgets and Reviews</a><br />
+- <a href="http://sites.proliphus.com/blueZhift/blog/">Thomas McKibben</a><br />
+- <a href="http://cheapweb.us/">CheapWeb.us</a><br />
+- Robert Seyfriedsberger<br />
+- <a href="http://www.toxicologie.nl/">Toxicologie.nl</a><br />
+- Gordon Shum<br />
+- <a href="http://www.subsim.com/">Neal Stevens</a><br />
+- <a href="http://www.GamblingHelper.com/">GamblingHelper</a><br />
+- Oliver Kirstein<br />
+- <a href="http://www.dominiek.be/">Dominiek</a><br />
+- <a href="http://www.aardschok.net/">Aardschok</a><br />
+- <a href="http://www.nieuwevoordeur.be/">nieuwevoordeur.be</a><br />
+- <a href="http://www.scene24.net/">Scene24</a><br />
+- <a href="http://www.eug.be/">Eug''s Weblog</a><br />
+- <a href="http://www.bloggard.com/">The Adventures of Bloggard</a><br />
+- <a href="http://www.voltos.com/">Arthur Cronos from Voltos</a><br />
+- <a href="http://www.webmaster-toolkit.com/">Free Webmaster Tools and Resources</a><br />
+- <a href="http://www.domilog.be/">Domi''s Weblog</a><br />
+- Infodoma             <br />
+- <a href="http://carvingcode.com/">carvingCode.com</a><br />
+- <a href="http://www.traweb.com/">Traweb</a><br />
+- <a href="http://gene.mm2u.com/">Gene''s MoBlog</a><br />
+- <a href="http://interfacethis.com/">InterfaceThis</a><br />
+- <a href="http://www.thefinsters.com/flog/">The Finster Log</a><br />
+- <a href="http://www.mrhop.com/">Hop Nguyen</a><br />
+- <a href="http://www.zwavel.com/~zwavelaars" title="Zwavelaars">Zwavelaars</a><br />
+- <a href="http://beefcake.nl/">Joaquin Scholten</a>   <br />
+- <a href="http://www.roelgroeneveld.com/">Roel Groeneveld</a><br />
+- <a href="http://lvb.net/">LVBlog</a><br />
+- <a href="http://xandermol.com/">Xander Mol</a><br />
+- Danilo Massa<br />
+- <a href="http://01FTP.com/">01FTP.com</a><br />
+- <a href="http://www.adrenalinsports.nl/">Irmo Keizer</a><br />
+- <a href="http://www.jasonkrogh.com/">Jason Krogh</a><br />
+- <a href="http://www.higuchi.com/">Osamu Higuchi</a><br />
+- <a href="http://www.trentadams.com/">Trent Adams</a><br />
+- <a href="http://www.ppcw.net/">Arne Hess</a><br />
+- <a href="http://hsbluebird.com/">The Bluebird</a><br />
+- Rainer Bickel<br />
+- Fritz Elfers<br />
+- <a href="http://www.european-wall-tapestries.com/">European Wall Tapestries</a><br />
+- <a href="http://www.jamier.net/">Jamie R. Rytlewski</a><br />
+- Madolyn Piper<br />
+- <a href="http://www.batteryvalues.com/">Battery Values</a><br />
+- <a href="http://www.mixburnrip.de/">Janko Roettgers</a><br />
+- Lukas Loesche<br />
+- <a href="http://www.seobook.com/">SEO Book</a><br />
+- <a href="http://www.brandweerdematen.nl/">Brandweer de Maten</a><br />
+- Andy Fuchs<br />
+- <a href="http://www.sumoforce.com/">Sumoforce</a><br />
+- <a href="http://love.silverindigo.com/">Al''ky''mie</a><br />
+- <a href="http://www.pejo.us/">Peter Johnson</a><br />
+- <a href="http://www.triv.nl/">TriV Internet Solutions</a><br />
+- <a href="http://www.torontomusicians.org/nucleus/">Margaret Stowe</a><br />
+- <a href="http://www.zenkey.org/">zenkey dot org</a><br />
+- <a href="http://www.golb.org/">Blots of Info</a><br />
+- <a href="http://www.zonderpartij.be/">Rudi De Kerpel</a><br />
+- <a href="http://staylorx.com/">Steve Taylor</a><br />
+- <a href="http://lmhcave.com/">Malcolm Farnsworth</a><br />
+- Birgit Kellner<br />
+- <a href="http://www.tobiasly.com/">Toby Johnson</a><br />
+- <a href="http://www.kapingamarangi.be/">Kapingamarangi</a><br />
+- <a href="http://www.pallalink.net/">Pallalink</a><br />
+- <a href="http://publiustx.net/">PubliusTX Weblog</a><br />
+- <a href="http://www.reductioadabsurdum.net/">Reductio Ad Absurdum</a><br />
+- <a href="http://www.gagaweb.org/">GagaWeb</a><br />
+- <a href="http://www.videokid.be/">Videokid</a><br />
+- Jon Marr<br />
+- <a href="http://www.docblog.org/">Luigi Cristiano</a><br />
+- J Keith Lehman<br />
+- Bohemian Cachet<br />
+- Jesus Mourazos<br />
+- <a href="http://ltp-design.com/">Stephen Jones</a><br />
+- <a href="http://oha.nu/">One-Handed Apps</a><br />
+- Alwin Hawkins<br />
+- <a href="http://jstigall.bloomington.in.us">Justin Stigall</a><br />
+- <a href="http://www.itismylife.com/">It is my life</a><br />
+- Greg Morrill<br />
+- <a href="http://www.dutchsubmarines.com/">Dutch Submarines</a><br />
+- <a href="http://www.7thwatch.com/">Seventh Watch Design Studios</a>          <br />
+- <a href="http://www.macnet2.com/">MacNetv2</a>       <br />
+- Richard Noordhof<br />
+- <a href="http://www.jamier.net/">Jamie Rytlewski</a><br />
+<br />
+Nucleusが気に入りましたか? <a href="http://www.hotscripts.com/Detailed/13368.html?RID=nucleus@demuynck.org">HotScripts</a>や<a href="http://www.opensourcecms.com/index.php?option=content&task=view&id=145">opensourceCMS</a>での投票をお願いします。<br />
+<br />
+<b>ライセンス</b><br />
+<br />
+私たちがフリー・ソフトウェアについて口にする場合は自由のことに言及しているのであって、価格のことではありません。私たちの<a href="http://www.gnu.org/licenses/gpl.html">一般公有使用許諾書</a>(<a href="http://www.gnu.org/licenses/gpl.ja.html">日本語訳</a>と<a href="http://www.atmarkit.co.jp/aig/03linux/gpl.html">概要</a>)は、フリー・ソフトウェアの複製物を自由に頒布できること(そして、望むならこのサービスに対して対価を請求できること)、ソース・コードを実際に受け取るか希望しさえすれば入手することが可能であること、入手したソフトウェアを変更したり新しいフリー・プログラムの一部として使用できること、以上の各内容を行なうことができるということをユーザ自身が知っていることを実現できるようにデザインされています。', 
+1, 1, '2005-02-16 22:57:54', 0, 0, 0, 1, 0, 1);
 
 CREATE TABLE `nucleus_karma` (
   `itemid` int(11) NOT NULL default '0',
 
 CREATE TABLE `nucleus_karma` (
   `itemid` int(11) NOT NULL default '0',
index 1c1785b..e665bd0 100755 (executable)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: bookmarklet.php,v 1.9 2007-02-04 06:28:45 kimitake Exp $
- * $NucleusJP: bookmarklet.php,v 1.8 2007/02/03 05:41:29 kimitake Exp $
+ * @version $Id: bookmarklet.php,v 1.10 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: bookmarklet.php,v 1.9.2.1 2007/09/07 07:16:39 kimitake Exp $
  */
 
 // bookmarklet is part of admin area (might need XML-RPC)
  */
 
 // bookmarklet is part of admin area (might need XML-RPC)
@@ -106,10 +106,10 @@ function bm_doAddItem() {
        if ($result['status'] == 'newcategory') {
                $message = 'アイテムは追加され、新しいカテゴリーが作成されました。 <a href="index.php?action=categoryedit&amp;blogid='.$blogid.'&amp;catid='.$result['catid'].'" onclick="if (event &amp;&amp; event.preventDefault) event.preventDefault(); window.open(this.href); return false;" title="Opens in new window">ここをクリックしてカテゴリーの名前と説明を編集してください。</a>';
                $extrahead = '';
        if ($result['status'] == 'newcategory') {
                $message = 'アイテムは追加され、新しいカテゴリーが作成されました。 <a href="index.php?action=categoryedit&amp;blogid='.$blogid.'&amp;catid='.$result['catid'].'" onclick="if (event &amp;&amp; event.preventDefault) event.preventDefault(); window.open(this.href); return false;" title="Opens in new window">ここをクリックしてカテゴリーの名前と説明を編集してください。</a>';
                $extrahead = '';
-       } elseif ((postVar('actiontype') == 'addnow') && $blog->pingUserland()) {
+       } elseif ( (postVar('actiontype') == 'addnow') && $blog->sendPing() ) {
                $message = 'アイテムの追加に成功しました。現在weblogs.comにpingを送っています。しばらくの間お待ちください...';
                $message = 'アイテムの追加に成功しました。現在weblogs.comにpingを送っています。しばらくの間お待ちください...';
-               $pingUrl = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=sendping&blogid=' . intval($blogid));
-               $extrahead = '<meta http-equiv="refresh" content="1; url=' . htmlspecialchars($pingUrl). '" />';
+               $pingUrl = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=sendping&blogid=' . intval($blogid) );
+               $extrahead = '<meta http-equiv="refresh" content="1; url=' . htmlspecialchars($pingUrl) . '" />';
        } else {
                $message = _ITEM_ADDED;
                $extrahead = '';
        } else {
                $message = _ITEM_ADDED;
                $extrahead = '';
@@ -238,8 +238,9 @@ function bm_doShowForm() {
        $log_text = uniDecode($log_text,_CHARSET);
        $log_linktitle = uniDecode($log_linktitle,_CHARSET);
        
        $log_text = uniDecode($log_text,_CHARSET);
        $log_linktitle = uniDecode($log_linktitle,_CHARSET);
        
-       if (!BLOG::existsID($blogid))
+       if (!BLOG::existsID($blogid) ) {
                bm_doError(_ERROR_NOSUCHBLOG);
                bm_doError(_ERROR_NOSUCHBLOG);
+       }
 
        if (!$member->isTeamMember($blogid) ) {
                bm_doError(_ERROR_NOTONTEAM);
 
        if (!$member->isTeamMember($blogid) ) {
                bm_doError(_ERROR_NOTONTEAM);
@@ -304,7 +305,7 @@ function bm_message($title, $head, $msg, $extrahead = '') {
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET ?>" />
-               <title><?php echo  $title ?></title>
+               <title><?php echo $title ?></title>
                <?php bm_style(); ?>
                <?php echo $extrahead; ?>
        </head>
                <?php bm_style(); ?>
                <?php echo $extrahead; ?>
        </head>
index b63dc34..7455839 100755 (executable)
@@ -1,8 +1,8 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-       <!-- $Id: forgotpassword.html,v 1.10 2007-02-21 15:19:32 kimitake Exp $ -->
-       <!-- $NucleusJP: forgotpassword.html,v 1.9 2007/02/04 06:28:45 kimitake Exp $ -->
+       <!-- $Id: forgotpassword.html,v 1.11 2008-02-08 09:31:22 kimitake Exp $ -->
+       <!-- $NucleusJP: forgotpassword.html,v 1.10.2.1 2007/09/07 07:34:18 kimitake Exp $ -->
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
        <title>Nucleus - パスワードの紛失</title>
        <style type="text/css">
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
        <title>Nucleus - パスワードの紛失</title>
        <style type="text/css">
        </style>
 </head>
 <body>
        </style>
 </head>
 <body>
-               <div class="header">
-               <h1>Nucleus CMS</h1>
-               </div>
-               <div id="content">
+       <div class="header">
+       <h1>Nucleus CMS</h1>
+       </div>
+
+       <div id="content">
+
+               <h2>パスワードを忘れましたか?</h2>
 
 
-                       <h2>パスワードを忘れましたか?</h2>
+               <p>以下にユーザー名とメールアドレスを入力してください。新しいパスワードを設定するページへのリンクの入ったメールが送信されます。</p>
 
 
+               <form method="post" action="../action.php">
                        <p>
                        <p>
-                       以下にユーザー名とメールアドレスを入力してください。新しいパスワードを選択するページへのリンクの入ったメールが送信されます。
-                       </p>
+                               <label for="nucleus_pf_username">ユーザー名:</label><br />
+                               <input type="text" name="name" id="nucleus_pf_username" /><br />
 
 
-                       <form method="post" action="../action.php"><p>
-                               <input name="action" value="forgotpassword" type="hidden" />
-                               ユーザー名:
-                               <br />
-                               <input name="name" />
+                               <label for="nucleus_pf_email">メールアドレス:</label><br />
+                               <input type="text" name="email" id="nucleus_pf_email" /><br />
                                <br />
                                <br />
-                               メールアドレス:
-                               <br />
-                               <input name="email" />
-                               <br />
-                               <br />
-                               <input type="submit" value="パスワードメールの送信" class="transparent" />
-                       </p></form>
 
 
-                       <p>
-                       もしユーザー名をお忘れなら、あなたのNucleusサイト管理者に連絡してください。
+                               <input type="hidden" name="action" value="forgotpassword" />
+                               <input type="submit" value="認証用リンクの送信" class="transparent" />
                        </p>
                        </p>
+               </form>
 
 
+               <p>もしユーザー名をお忘れなら、あなたのNucleusサイト管理者に連絡してください。</p>
 
 
-                       <div class="foot">
-                               <a href="http://nucleuscms.org/">Nucleus &copy; 2001-2007 The Nucleus Group</a>
-                       </div>
+               <div class="foot">
+                       <a href="http://nucleuscms.org/">Nucleus &copy; 2001-2007 The Nucleus Group</a>
+               </div>
 
 
-               </div><!-- content -->
+       </div>
 
 </body>
 </html>
 
 </body>
 </html>
index ebb4bea..7693bd6 100755 (executable)
@@ -12,8 +12,8 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: index.php,v 1.8 2007-02-04 06:28:45 kimitake Exp $
- * $NucleusJP: index.php,v 1.7 2006/07/17 20:01:39 kimitake Exp $
+ * @version $Id: index.php,v 1.9 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: index.php,v 1.8.2.1 2007/09/07 07:36:09 kimitake Exp $
  */
        // we are using admin stuff:
        $CONF = array();
  */
        // we are using admin stuff:
        $CONF = array();
@@ -70,7 +70,7 @@
                $action = 'showlogin';
        }
 
                $action = 'showlogin';
        }
 
-       sendContentType('application/xhtml+xml', 'admin-' . $action);
+       sendContentType('text/html', 'admin-' . $action);
 
        $admin = new ADMIN();
        $admin->action($action);
 
        $admin = new ADMIN();
        $admin->action($action);
index a54a563..db8f3a5 100755 (executable)
@@ -10,8 +10,8 @@
   *  
   * Some JavaScript code for the admin area
   *
   *  
   * Some JavaScript code for the admin area
   *
-  * $Id: admin.js,v 1.6 2007-02-28 07:22:22 kimitake Exp $
-  * $NucleusJP: admin.js,v 1.5 2007/02/04 06:28:45 kimitake Exp $
+  * $Id: admin.js,v 1.7 2008-02-08 09:31:22 kimitake Exp $
+  * $NucleusJP: admin.js,v 1.6.2.1 2007/09/05 05:58:56 kimitake Exp $
   */
 
 function help(url) {
   */
 
 function help(url) {
index 9510a75..d5ff737 100755 (executable)
 // Fully translated language file can be sent to us and will be made
 // available for download (with proper credit to the author, of course)
 
 // Fully translated language file can be sent to us and will be made
 // available for download (with proper credit to the author, of course)
 
+// START changed/added after 3.31 START
+define('_CREATE_ACCOUNT0', 'Create Account');
+define('_CREATE_ACCOUNT1', 'Visitors are not allowed to create a Member Account.<br /><br />');
+define('_CREATE_ACCOUNT2', 'Please contact the website administrator for more information.');
+define('_CREATE_ACCOUNT_LOGIN_NAME',   'Login Name (required):');
+define('_CREATE_ACCOUNT_REAL_NAME',            'Real Name (required):');
+define('_CREATE_ACCOUNT_EMAIL',                        'Email (required):');
+define('_CREATE_ACCOUNT_EMAIL2',               '(must be valid, because an activation link will be sent over there)');
+define('_CREATE_ACCOUNT_URL',                  'URL:');
+define('_CREATE_ACCOUNT_SUBMIT',               'Create Account');
+
+
 // START changed/added after 3.3 START
 define('_AUTOSAVEDRAFT',               'Auto save draft');
 define('_AUTOSAVEDRAFT_LASTSAVED',     'Last saved: ');
 // START changed/added after 3.3 START
 define('_AUTOSAVEDRAFT',               'Auto save draft');
 define('_AUTOSAVEDRAFT_LASTSAVED',     'Last saved: ');
index 4680d06..63869a7 100755 (executable)
@@ -30,6 +30,17 @@ define('_BOOKMARKLET_SEND_PING',     'アイテムの追加に成功しました。
 
 // END merge UTF-8 and EUC-JP
 
 
 // END merge UTF-8 and EUC-JP
 
+// START changed/added after 3.31 START
+define('_CREATE_ACCOUNT0', 'アカウントの作成');
+define('_CREATE_ACCOUNT1', 'ビジターのよるメンバーアカウントの作成は許可されていません。<br /><br />');
+define('_CREATE_ACCOUNT2', '詳細はウェブサイトの管理者にお問い合わせください。');
+define('_CREATE_ACCOUNT_LOGIN_NAME',   'ログイン名 (必須):');
+define('_CREATE_ACCOUNT_REAL_NAME',            '本名 (必須):');
+define('_CREATE_ACCOUNT_EMAIL',                        'Email (必須):');
+define('_CREATE_ACCOUNT_EMAIL2',               '(アクティベーション用のリンクが送られるので有効なものを使用してください)');
+define('_CREATE_ACCOUNT_URL',                  'URL:');
+define('_CREATE_ACCOUNT_SUBMIT',               'アカウントの作成');
+
 
 // START changed/added after 3.3 START
 define('_AUTOSAVEDRAFT',                       'ドラフト保存状況');
 
 // START changed/added after 3.3 START
 define('_AUTOSAVEDRAFT',                       'ドラフト保存状況');
@@ -694,7 +705,7 @@ define('_EBLOG_NOTIFY_ON',                  '以下を通知する');
 define('_EBLOG_NOTIFY_COMMENT',                '新しいコメント');
 define('_EBLOG_NOTIFY_KARMA',          '新しいカルマ投票');
 define('_EBLOG_NOTIFY_ITEM',           '新しいBlogアイテム');
 define('_EBLOG_NOTIFY_COMMENT',                '新しいコメント');
 define('_EBLOG_NOTIFY_KARMA',          '新しいカルマ投票');
 define('_EBLOG_NOTIFY_ITEM',           '新しいBlogアイテム');
-define('_EBLOG_PING',                          '更新時に Weblogs.com へPingを送りますか?');
+define('_EBLOG_PING',                          '更新時にweblogsアップデート通知サービスへPingを送りますか?');
 define('_EBLOG_MAXCOMMENTS',           'コメントの最大量');
 define('_EBLOG_UPDATE',                                '自動更新するファイル');
 define('_EBLOG_OFFSET',                                'サーバ時刻との時差');
 define('_EBLOG_MAXCOMMENTS',           'コメントの最大量');
 define('_EBLOG_UPDATE',                                '自動更新するファイル');
 define('_EBLOG_OFFSET',                                'サーバ時刻との時差');
index a89fa87..fb56aed 100755 (executable)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ACTION.php,v 1.10 2007-05-31 07:23:39 kimitake Exp $
- * $NucleusJP: ACTION.php,v 1.9 2007/05/10 08:11:32 kimitake Exp $
+ * @version $Id: ACTION.php,v 1.11 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: ACTION.php,v 1.10 2007/05/31 07:23:39 kimitake Exp $
  */
 class ACTION
 {
  */
 class ACTION
 {
@@ -198,30 +198,42 @@ class ACTION
                if (!$CONF['AllowMemberCreate'])
                        doError(_ERROR_MEMBERCREATEDISABLED);
 
                if (!$CONF['AllowMemberCreate'])
                        doError(_ERROR_MEMBERCREATEDISABLED);
 
-               // even though the member can not log in, set some random initial password. One never knows.
-               srand((double)microtime()*1000000);
-               $initialPwd = md5(uniqid(rand(), true));
+               // evaluate content from FormExtra
+               $result = 1;
+               $manager->notify('ValidateForm', array('type' => 'membermail', 'error' => &$result));
 
 
-               // create member (non admin/can not login/no notes/random string as password)
-               $r = MEMBER::create(postVar('name'), postVar('realname'), $initialPwd, postVar('email'), postVar('url'), 0, 0, '');
+               if ($result!=1) {
+                       return $result;
+               }
+               else {
 
 
-               if ($r != 1)
-                       doError($r);
+                       // even though the member can not log in, set some random initial password. One never knows.
+                       srand((double)microtime()*1000000);
+                       $initialPwd = md5(uniqid(rand(), true));
 
 
-               // send message containing password.
-               $newmem = new MEMBER();
-               $newmem->readFromName(postVar('name'));
-               $newmem->sendActivationLink('register');
+                       // create member (non admin/can not login/no notes/random string as password)
+                       $r = MEMBER::create(postVar('name'), postVar('realname'), $initialPwd, postVar('email'), postVar('url'), 0, 0, '');
 
 
-               $manager->notify('PostRegister',array('member' => &$newmem));
+                       if ($r != 1) {
+                               return $r;
+                       }
 
 
-               if (postVar('desturl')) {
-                       redirect(postVar('desturl'));
-               } else {
-                       header ("Content-Type: text/html; charset="._CHARSET);
-                       echo _MSG_ACTIVATION_SENT;
+                       // send message containing password.
+                       $newmem = new MEMBER();
+                       $newmem->readFromName(postVar('name'));
+                       $newmem->sendActivationLink('register');
+
+                       $manager->notify('PostRegister',array('member' => &$newmem));
+
+                       if (postVar('desturl')) {
+                               redirect(postVar('desturl'));
+                       } else {
+                               // header has been already sent, so deleted the line below
+                               //header ("Content-Type: text/html; charset="._CHARSET);
+                               echo _MSG_ACTIVATION_SENT;
+                       }
+                       exit;
                }
                }
-               exit;
        }
 
        /**
        }
 
        /**
@@ -384,7 +396,7 @@ class ACTION
                global $manager;
                if ($manager->checkTicket()) {
                        $manager->loadClass('ITEM');
                global $manager;
                if ($manager->checkTicket()) {
                        $manager->loadClass('ITEM');
-                       $info = ITEM::CreateDraftFromRequest();
+                       $info = ITEM::createDraftFromRequest();
                        if ($info['status'] == 'error') {
                                echo $info['message'];
                        }
                        if ($info['status'] == 'error') {
                                echo $info['message'];
                        }
@@ -401,4 +413,4 @@ class ACTION
 
 }
 
 
 }
 
-?>
\ No newline at end of file
+?>
index 3f91f15..8278da3 100755 (executable)
@@ -14,8 +14,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ADMIN.php,v 1.23 2007-05-31 07:20:48 kimitake Exp $
- * @version $NucleusJP: ADMIN.php,v 1.20 2007/03/22 03:30:14 kmorimatsu Exp $
+ * @version $Id: ADMIN.php,v 1.24 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: ADMIN.php,v 1.21.2.4 2007/10/30 19:04:24 kmorimatsu Exp $
  */
 
 if ( !function_exists('requestVar') ) exit;
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -1175,7 +1175,7 @@ class ADMIN {
 
                $this->updateFuturePosted($blogid);
 
 
                $this->updateFuturePosted($blogid);
 
-               if ($draftid > 0) {
+               if ($draftid > 0 && $member->canAlterItem($draftid)) {
                        ITEM::delete($draftid);
                }
 
                        ITEM::delete($draftid);
                }
 
@@ -1466,7 +1466,7 @@ class ADMIN {
 
                <h2>Pinging services, please wait...</h2>
                <div class='note'>
 
                <h2>Pinging services, please wait...</h2>
                <div class='note'>
-                <?
+                <?php
 
                // send sendPing event
                $manager->notify('SendPing', array('blogid' => $blogid));
 
                // send sendPing event
                $manager->notify('SendPing', array('blogid' => $blogid));
@@ -2349,11 +2349,11 @@ class ADMIN {
 
                // check if: - there remains at least one blog admin
                //           - (there remains at least one team member)
 
                // check if: - there remains at least one blog admin
                //           - (there remains at least one team member)
-               $tmem = MEMBER::createFromID($memberid);
+               $mem = MEMBER::createFromID($memberid);
 
                $manager->notify('PreDeleteTeamMember', array('member' => &$mem, 'blogid' => $blogid));
 
 
                $manager->notify('PreDeleteTeamMember', array('member' => &$mem, 'blogid' => $blogid));
 
-               if ($tmem->isBlogAdmin($blogid)) {
+               if ($mem->isBlogAdmin($blogid)) {
                        // check if there are more blog members left and at least one admin
                        // (check for at least two admins before deletion)
                        $query = 'SELECT * FROM '.sql_table('team') . ' WHERE tblog='.$blogid.' and tadmin=1';
                        // check if there are more blog members left and at least one admin
                        // (check for at least two admins before deletion)
                        $query = 'SELECT * FROM '.sql_table('team') . ' WHERE tblog='.$blogid.' and tadmin=1';
@@ -2519,13 +2519,13 @@ class ADMIN {
                                /><label for="notifyNewItem"><?php echo _EBLOG_NOTIFY_ITEM?></label>
                        </td>
                </tr><tr>
                                /><label for="notifyNewItem"><?php echo _EBLOG_NOTIFY_ITEM?></label>
                        </td>
                </tr><tr>
-               <? 
+               <?php
                if (numberOfEventSubscriber('SendPing') > 0) {
                ?>
                        <td><?php echo _EBLOG_PING?> <?php help('sendping'); ?></td>
                        <td><?php $this->input_yesno('sendping',$blog->sendPing(),85); ?></td>
                </tr><tr>
                if (numberOfEventSubscriber('SendPing') > 0) {
                ?>
                        <td><?php echo _EBLOG_PING?> <?php help('sendping'); ?></td>
                        <td><?php $this->input_yesno('sendping',$blog->sendPing(),85); ?></td>
                </tr><tr>
-               <?
+               <?php
                }
                ?>
                        <td><?php echo _EBLOG_MAXCOMMENTS?> <?php help('blogmaxcomments'); ?></td>
                }
                ?>
                        <td><?php echo _EBLOG_MAXCOMMENTS?> <?php help('blogmaxcomments'); ?></td>
@@ -3292,7 +3292,7 @@ class ADMIN {
                                'name' => &$bname,
                                'shortname' => &$bshortname,
                                'timeoffset' => &$btimeoffset,
                                'name' => &$bname,
                                'shortname' => &$bshortname,
                                'timeoffset' => &$btimeoffset,
-                               'description' => &$bdescription,
+                               'description' => &$bdesc,
                                'defaultskin' => &$bdefskin
                        )
                );
                                'defaultskin' => &$bdefskin
                        )
                );
@@ -5264,7 +5264,7 @@ selector();
                <p>
                        「お気に入り」もしくはツールバーから消すには、単に削除するだけです。
                </p>
                <p>
                        「お気に入り」もしくはツールバーから消すには、単に削除するだけです。
                </p>
-
+               
                <p>
                        右クリックメニューから消したい時は、以下の手順を踏んでください:
                </p>
                <p>
                        右クリックメニューから消したい時は、以下の手順を踏んでください:
                </p>
@@ -6045,7 +6045,9 @@ selector();
                sql_query('UPDATE '.sql_table('plugin').' SET porder='.$oldOrder.' WHERE porder='.$newOrder);
                sql_query('UPDATE '.sql_table('plugin').' SET porder='.$newOrder.' WHERE pid='.$plugid);
 
                sql_query('UPDATE '.sql_table('plugin').' SET porder='.$oldOrder.' WHERE porder='.$newOrder);
                sql_query('UPDATE '.sql_table('plugin').' SET porder='.$newOrder.' WHERE pid='.$plugid);
 
-               $this->action_pluginlist();
+               //$this->action_pluginlist();
+               // To avoid showing ticket in the URL, redirect to pluginlist, instead.
+               redirect('?action=pluginlist');
        }
 
        /**
        }
 
        /**
@@ -6076,7 +6078,9 @@ selector();
                sql_query('UPDATE '.sql_table('plugin').' SET porder='.$oldOrder.' WHERE porder='.$newOrder);
                sql_query('UPDATE '.sql_table('plugin').' SET porder='.$newOrder.' WHERE pid='.$plugid);
 
                sql_query('UPDATE '.sql_table('plugin').' SET porder='.$oldOrder.' WHERE porder='.$newOrder);
                sql_query('UPDATE '.sql_table('plugin').' SET porder='.$newOrder.' WHERE pid='.$plugid);
 
-               $this->action_pluginlist();
+               //$this->action_pluginlist();
+               // To avoid showing ticket in the URL, redirect to pluginlist, instead.
+               redirect('?action=pluginlist');
        }
 
        /**
        }
 
        /**
index cf1125e..3b09f93 100755 (executable)
@@ -16,8 +16,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: BLOG.php,v 1.14 2007-05-31 07:28:30 kimitake Exp $
- * $NucleusJP: BLOG.php,v 1.13 2007/05/01 08:39:18 kimitake Exp $
+ * @version $Id: BLOG.php,v 1.15 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: BLOG.php,v 1.12.2.2 2007/08/08 05:26:22 kimitake Exp $
  */
 
 if ( !function_exists('requestVar') ) exit;
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -782,24 +782,24 @@ class BLOG {
 
        function isValidCategory($catid) {
                $query = 'SELECT * FROM '.sql_table('category').' WHERE cblog=' . $this->getID() . ' and catid=' . intval($catid);
 
        function isValidCategory($catid) {
                $query = 'SELECT * FROM '.sql_table('category').' WHERE cblog=' . $this->getID() . ' and catid=' . intval($catid);
-               $res = mysql_query($query);
+               $res = sql_query($query);
                return (mysql_num_rows($res) != 0);
        }
 
        function getCategoryName($catid) {
                return (mysql_num_rows($res) != 0);
        }
 
        function getCategoryName($catid) {
-               $res = mysql_query('SELECT cname FROM '.sql_table('category').' WHERE cblog='.$this->getID().' and catid=' . intval($catid));
+               $res = sql_query('SELECT cname FROM '.sql_table('category').' WHERE cblog='.$this->getID().' and catid=' . intval($catid));
                $o = mysql_fetch_object($res);
                return $o->cname;
        }
 
        function getCategoryDesc($catid) {
                $o = mysql_fetch_object($res);
                return $o->cname;
        }
 
        function getCategoryDesc($catid) {
-               $res = mysql_query('SELECT cdesc FROM '.sql_table('category').' WHERE cblog='.$this->getID().' and catid=' . intval($catid));
+               $res = sql_query('SELECT cdesc FROM '.sql_table('category').' WHERE cblog='.$this->getID().' and catid=' . intval($catid));
                $o = mysql_fetch_object($res);
                return $o->cdesc;
        }
 
        function getCategoryIdFromName($name) {
                $o = mysql_fetch_object($res);
                return $o->cdesc;
        }
 
        function getCategoryIdFromName($name) {
-               $res = mysql_query('SELECT catid FROM '.sql_table('category').' WHERE cblog='.$this->getID().' and cname="' . addslashes($name) . '"');
+               $res = sql_query('SELECT catid FROM '.sql_table('category').' WHERE cblog='.$this->getID().' and cname="' . addslashes($name) . '"');
                if (mysql_num_rows($res) > 0) {
                        $o = mysql_fetch_object($res);
                        return $o->catid;
                if (mysql_num_rows($res) > 0) {
                        $o = mysql_fetch_object($res);
                        return $o->catid;
index 4093332..897fc80 100644 (file)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: BODYACTIONS.php,v 1.6 2007-04-19 06:13:50 kimitake Exp $
- * @version $NucleusJP: BODYACTIONS.php,v 1.5 2007/03/22 03:30:14 kmorimatsu Exp $
+ * @version $Id: BODYACTIONS.php,v 1.7 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: BODYACTIONS.php,v 1.6.2.1 2007/08/08 05:27:14 kimitake Exp $
  */
 
 class BODYACTIONS extends BaseActions {
  */
 
 class BODYACTIONS extends BaseActions {
index 87c46d1..17f6e85 100644 (file)
@@ -14,8 +14,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: COMMENTACTIONS.php,v 1.5 2007-04-20 08:43:57 kimitake Exp $
- * @version $NucleusJP: COMMENTACTIONS.php,v 1.4 2007/03/19 10:20:24 shizuki Exp $
+ * @version $Id: COMMENTACTIONS.php,v 1.6 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: COMMENTACTIONS.php,v 1.5.2.1 2007/08/08 05:31:31 kimitake Exp $
  */
 
 class COMMENTACTIONS extends BaseActions {
  */
 
 class COMMENTACTIONS extends BaseActions {
index 001b175..ec2ecc4 100755 (executable)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: COMMENTS.php,v 1.9 2007-03-20 19:31:29 kmorimatsu Exp $
- * $NucleusJP: COMMENTS.php,v 1.8 2007/03/13 05:12:19 shizuki Exp $
+ * @version $Id: COMMENTS.php,v 1.10 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: COMMENTS.php,v 1.9.2.1 2007/08/08 05:32:21 kimitake Exp $
  */
 
 if ( !function_exists('requestVar') ) exit;
  */
 
 if ( !function_exists('requestVar') ) exit;
@@ -322,4 +322,4 @@ class COMMENTS {
 
 }
 
 
 }
 
-?>
\ No newline at end of file
+?>
index 666cc0c..5bcaafd 100644 (file)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ENCAPSULATE.php,v 1.4 2007-03-22 03:30:14 kmorimatsu Exp $
- * @version $NucleusJP: ENCAPSULATE.php,v 1.3 2007/02/04 06:28:46 kimitake Exp $
+ * @version $Id: ENCAPSULATE.php,v 1.5 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: ENCAPSULATE.php,v 1.4.2.1 2007/08/08 05:32:54 kimitake Exp $
  */
 
 class ENCAPSULATE {
  */
 
 class ENCAPSULATE {
index 6a1cec8..86f18e4 100755 (executable)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ITEM.php,v 1.7 2007-02-04 06:28:46 kimitake Exp $
- * $NucleusJP: ITEM.php,v 1.6 2006/07/20 08:01:52 kimitake Exp $
+ * @version $Id: ITEM.php,v 1.8 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: ITEM.php,v 1.7.2.3 2008/02/07 06:13:30 kimitake Exp $
  */
 class ITEM {
 
  */
 class ITEM {
 
@@ -141,7 +141,15 @@ class ITEM {
                        $posttime = $i_draft ? 0 : $blog->getCorrectTime();
                }
 
                        $posttime = $i_draft ? 0 : $blog->getCorrectTime();
                }
 
-               $itemid = $blog->additem($i_catid, $i_title,$i_body,$i_more,$i_blogid,$i_author,$posttime,$i_closed,$i_draft);
+               if ($posttime > $blog->getCorrectTime()) {
+                       $posted = 0;
+                       $blog->setFuturePost();
+               }
+               else {
+                       $posted = 1;
+               }
+
+               $itemid = $blog->additem($i_catid, $i_title,$i_body,$i_more,$i_blogid,$i_author,$posttime,$i_closed,$i_draft,$posted);
 
                //Setting the itemOptions
                $aOptions = requestArray('plugoption');
 
                //Setting the itemOptions
                $aOptions = requestArray('plugoption');
@@ -203,14 +211,20 @@ class ITEM {
                if ( (!$blog->allowPastPosting()) && ($timestamp < $blog->getCorrectTime()))
                                $timestamp = 0;
 
                if ( (!$blog->allowPastPosting()) && ($timestamp < $blog->getCorrectTime()))
                                $timestamp = 0;
 
-               if ($wasdraft && $publish) {
-                       $query .= ', idraft=0';
+               if ($timestamp > $blog->getCorrectTime(time())) {
+                       $isFuture = 1;
+                       $query .= ', iposted=0';
+               }
+               else {
+                       $isFuture = 0;
+                       $query .= ', iposted=1';
+               }
 
 
+               if ($wasdraft && $publish) {
                        // set timestamp to current date only if it's not a future item
                        // draft items have timestamp == 0
                        // don't allow timestamps in the past (unless otherwise defined in blogsettings)
                        // set timestamp to current date only if it's not a future item
                        // draft items have timestamp == 0
                        // don't allow timestamps in the past (unless otherwise defined in blogsettings)
-                       if ($timestamp > $blog->getCorrectTime())
-                               $isFuture = 1;
+                       $query .= ', idraft=0';
 
                        if ($timestamp == 0)
                                $timestamp = $blog->getCorrectTime();
 
                        if ($timestamp == 0)
                                $timestamp = $blog->getCorrectTime();
@@ -342,6 +356,12 @@ class ITEM {
                $i_body = postVar('body');
                $i_title = postVar('title');
                $i_more = postVar('more');
                $i_body = postVar('body');
                $i_title = postVar('title');
                $i_more = postVar('more');
+
+               if(_CHARSET != 'UTF-8'){
+                       $i_body = mb_convert_encoding($i_body, _CHARSET, "UTF-8");
+                       $i_title = mb_convert_encoding($i_title, _CHARSET, "UTF-8");
+                       $i_more = mb_convert_encoding($i_more, _CHARSET, "UTF-8");
+               }
                //$i_actiontype = postVar('actiontype');
                $i_closed = intPostVar('closed');
                //$i_hour = intPostVar('hour');
                //$i_actiontype = postVar('actiontype');
                $i_closed = intPostVar('closed');
                //$i_hour = intPostVar('hour');
index f195a92..2cbef56 100644 (file)
@@ -14,8 +14,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: ITEMACTIONS.php,v 1.5 2007-03-22 03:30:14 kmorimatsu Exp $
- * @version $NucleusJP: ITEMACTIONS.php,v 1.4 2007/03/13 05:04:13 shizuki Exp $
+ * @version $Id: ITEMACTIONS.php,v 1.6 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: ITEMACTIONS.php,v 1.5.2.3 2007/10/30 19:05:20 kmorimatsu Exp $
  */
 class ITEMACTIONS extends BaseActions {
 
  */
 class ITEMACTIONS extends BaseActions {
 
@@ -206,18 +206,27 @@ class ITEMACTIONS extends BaseActions {
        }
 
        function parse_title($format = '') {
        }
 
        function parse_title($format = '') {
+               if (is_array($this->currentItem)) {
+                       $itemtitle = $this->currentItem['title'];
+               } elseif (is_object($this->currentItem)) {
+                       $itemtitle = $this->currentItem->title;
+               }
                switch ($format) {
                        case 'xml':
                switch ($format) {
                        case 'xml':
-                               echo stringToXML ($this->currentItem->title);
+//                             echo stringToXML ($this->currentItem->title);
+                               echo stringToXML ($itemtitle);
                                break;
                        case 'attribute':
                                break;
                        case 'attribute':
-                               echo stringToAttribute ($this->currentItem->title);
+//                             echo stringToAttribute ($this->currentItem->title);
+                               echo stringToAttribute ($itemtitle);
                                break;
                        case 'raw':
                                break;
                        case 'raw':
-                               echo $this->currentItem->title;
+//                             echo $this->currentItem->title;
+                               echo $itemtitle;
                                break;
                        default:
                                break;
                        default:
-                               $this->highlightAndParse($this->currentItem->title);
+//                             $this->highlightAndParse($this->currentItem->title);
+                               $this->highlightAndParse($itemtitle);
                                break;
                }
        }
                                break;
                }
        }
@@ -337,6 +346,7 @@ class ITEMACTIONS extends BaseActions {
                        echo $this->template['NEW'];
        }
 
                        echo $this->template['NEW'];
        }
 
+
        function parse_daylink() {
                echo createArchiveLink($this->blog->getID(), strftime('%Y-%m-%d',$this->currentItem->timestamp), $this->linkparams);
        }
        function parse_daylink() {
                echo createArchiveLink($this->blog->getID(), strftime('%Y-%m-%d',$this->currentItem->timestamp), $this->linkparams);
        }
@@ -395,7 +405,7 @@ class ITEMACTIONS extends BaseActions {
        }
 
        function parse_editpopupcode() {
        }
 
        function parse_editpopupcode() {
-               echo "if (event &amp;&amp; event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";
+               echo "if (event &amp;&amp; event.preventDefault) event.preventDefault();winbm=window.open(this.href,'nucleusbm','scrollbars=yes,width=600,height=550,left=10,top=10,status=yes,resizable=yes');winbm.focus();return false;";
        }
 
        // helper functions
        }
 
        // helper functions
@@ -425,6 +435,9 @@ class ITEMACTIONS extends BaseActions {
                $this->parser->actions = $this->getDefinedActions();
        }
        */
                $this->parser->actions = $this->getDefinedActions();
        }
        */
+
 }
 }
+       
+
 
 
-?>
\ No newline at end of file
+?>
index 055e6a6..4176a58 100755 (executable)
@@ -20,8 +20,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: MANAGER.php,v 1.8 2007-04-06 19:36:29 kmorimatsu Exp $
- * $NucleusJP: MANAGER.php,v 1.7 2007/02/04 06:28:46 kimitake Exp $
+ * @version $Id: MANAGER.php,v 1.9 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: MANAGER.php,v 1.8.2.1 2007/09/05 07:00:18 kimitake Exp $
  */
 class MANAGER {
 
  */
 class MANAGER {
 
index 92f1ec7..73adef0 100755 (executable)
@@ -12,8 +12,8 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: PAGEFACTORY.php,v 1.8 2007-03-22 03:30:14 kmorimatsu Exp $
- * $NucleusJP: PAGEFACTORY.php,v 1.7 2007/02/04 06:28:46 kimitake Exp $
+ * @version $Id: PAGEFACTORY.php,v 1.9 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: PAGEFACTORY.php,v 1.8.2.2 2007/10/30 16:12:27 shizuki Exp $
  */
 
 /**
  */
 
 /**
@@ -179,7 +179,7 @@ class PAGEFACTORY extends BaseActions {
        }
 
        function parse_bloglink() {
        }
 
        function parse_bloglink() {
-               echo '<a href="'.htmlspecialchars($this->blog->getURL()).'">'.$this->blog->getName().'</a>';
+               echo '<a href="'.htmlspecialchars($this->blog->getURL()).'">'.htmlspecialchars($this->blog->getName()).'</a>';
        }
 
        function parse_authorname() {
        }
 
        function parse_authorname() {
@@ -340,9 +340,9 @@ class PAGEFACTORY extends BaseActions {
                        case "2":
                                echo '<div class="jsbuttonbar">';
 
                        case "2":
                                echo '<div class="jsbuttonbar">';
 
-                                       $this->_jsbutton('bold',"boldThis()",'');
-                                       $this->_jsbutton('italic',"italicThis()",'');
-                                       $this->_jsbutton('link',"ahrefThis()",'');
+                                       $this->_jsbutton('bold',"boldThis()",_ADD_BOLD_TT);
+                                       $this->_jsbutton('italic',"italicThis()",_ADD_ITALIC_TT);
+                                       $this->_jsbutton('link',"ahrefThis()",_ADD_HREF_TT);
                                        $this->_jsbuttonspacer();
                                        $this->_jsbutton('alignleft',"alignleftThis()",_ADD_ALIGNLEFT_TT);
                                        $this->_jsbutton('alignright',"alignrightThis()",_ADD_ALIGNRIGHT_TT);
                                        $this->_jsbuttonspacer();
                                        $this->_jsbutton('alignleft',"alignleftThis()",_ADD_ALIGNLEFT_TT);
                                        $this->_jsbutton('alignright',"alignrightThis()",_ADD_ALIGNRIGHT_TT);
index fdef712..79a2ad2 100755 (executable)
@@ -12,8 +12,8 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: PARSER.php,v 1.7 2007-03-20 19:31:29 kmorimatsu Exp $
- * $NucleusJP: PARSER.php,v 1.6 2007/02/04 06:28:46 kimitake Exp $
+ * @version $Id: PARSER.php,v 1.8 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: PARSER.php,v 1.7.2.1 2007/09/05 07:35:59 kimitake Exp $
  */
 
 if ( !function_exists('requestVar') ) exit;
  */
 
 if ( !function_exists('requestVar') ) exit;
index 0550115..9827705 100755 (executable)
@@ -17,8 +17,8 @@
         *
         * @license http://nucleuscms.org/license.txt GNU General Public License
         * @copyright Copyright (C) 2002-2007 The Nucleus Group
         *
         * @license http://nucleuscms.org/license.txt GNU General Public License
         * @copyright Copyright (C) 2002-2007 The Nucleus Group
-        * @version $Id: PLUGIN.php,v 1.12 2007-04-20 08:43:25 kimitake Exp $
-        * $NucleusJP: PLUGIN.php,v 1.11 2007/04/06 19:36:29 kmorimatsu Exp $
+        * @version $Id: PLUGIN.php,v 1.13 2008-02-08 09:31:22 kimitake Exp $
+        * $NucleusJP: PLUGIN.php,v 1.12.2.3 2007/12/03 02:22:42 kmorimatsu Exp $
         */
        class NucleusPlugin {
 
         */
        class NucleusPlugin {
 
                /**
                  * Retrieves the current value for an option
                  */
                /**
                  * Retrieves the current value for an option
                  */
-               function getOption($name){
-                       return $this->_getOption('global', 0, $name);
+               function getOption($name)
+               {
+                       // only request the options the very first time. On subsequent requests
+                       // the static collection is used to save SQL queries.
+                       if ($this->plugin_options == 0)
+                       {
+                               $this->plugin_options = array();
+                               $query = sql_query(
+                                        'SELECT d.oname as name, o.ovalue as value '.
+                                        'FROM '.
+                                        sql_table('plugin_option').' o, '.
+                                        sql_table('plugin_option_desc').' d '.
+                                        'WHERE d.opid='. intval($this->getID()).' AND d.oid=o.oid'
+                               );
+                               while ($row = mysql_fetch_object($query))
+                                       $this->plugin_options[strtolower($row->name)] = $row->value;
+                 }
+                 if (isset($this->plugin_options[strtolower($name)]))
+                               return $this->plugin_options[strtolower($name)];
+                 else
+                               return $this->_getOption('global', 0, $name);
                }
                }
+
                function getBlogOption($blogid, $name) {
                        return $this->_getOption('blog', $blogid, $name);
                }
                function getBlogOption($blogid, $name) {
                        return $this->_getOption('blog', $blogid, $name);
                }
 
                        // retrieve the data and return
                        $q = 'SELECT otype, oextra FROM '.sql_table('plugin_option_desc').' WHERE oid = '.$oid;
 
                        // retrieve the data and return
                        $q = 'SELECT otype, oextra FROM '.sql_table('plugin_option_desc').' WHERE oid = '.$oid;
-                       $query = mysql_query($q);
+                       $query = sql_query($q);
 
                        $o = mysql_fetch_array($query);
 
 
                        $o = mysql_fetch_array($query);
 
                                $orderby = 'ovalue';
                        }
                        $q = 'SELECT ovalue value, ocontextid id FROM '.sql_table('plugin_option').' WHERE oid = '.$oid.' ORDER BY '.$orderby.' '.$sort.' LIMIT 0,'.intval($amount);
                                $orderby = 'ovalue';
                        }
                        $q = 'SELECT ovalue value, ocontextid id FROM '.sql_table('plugin_option').' WHERE oid = '.$oid.' ORDER BY '.$orderby.' '.$sort.' LIMIT 0,'.intval($amount);
-                       $query = mysql_query($q);
+                       $query = sql_query($q);
 
                        // create the array
                        $i = 0;
 
                        // create the array
                        $i = 0;
 
                        // update plugin_option
                        sql_query('DELETE FROM ' . sql_table('plugin_option') . ' WHERE oid='.intval($oid) . ' and ocontextid='. intval($contextid));
 
                        // update plugin_option
                        sql_query('DELETE FROM ' . sql_table('plugin_option') . ' WHERE oid='.intval($oid) . ' and ocontextid='. intval($contextid));
-                       @mysql_query('INSERT INTO ' . sql_table('plugin_option') . ' (ovalue, oid, ocontextid) VALUES (\''.addslashes($value).'\', '. intval($oid) . ', ' . intval($contextid) . ')');
+                       sql_query('INSERT INTO ' . sql_table('plugin_option') . ' (ovalue, oid, ocontextid) VALUES (\''.addslashes($value).'\', '. intval($oid) . ', ' . intval($contextid) . ')');
 
                        // update cache
                        $this->_aOptionValues[$oid . '_' . $contextid] = $value;
 
                        // update cache
                        $this->_aOptionValues[$oid . '_' . $contextid] = $value;
                 */
                function _getOID($context, $name) {
                        $key = $context . '_' . $name;
                 */
                function _getOID($context, $name) {
                        $key = $context . '_' . $name;
-                       $info = $this->_aOptionToInfo[$key];
+                       $info = @$this->_aOptionToInfo[$key];
                        if (is_array($info)) return $info['oid'];
 
                        // load all OIDs for this plugin from the database
                        if (is_array($info)) return $info['oid'];
 
                        // load all OIDs for this plugin from the database
                        }
                        mysql_free_result($res);
 
                        }
                        mysql_free_result($res);
 
-                       return $this->_aOptionToInfo[$key]['oid'];
+                       return @$this->_aOptionToInfo[$key]['oid'];
                }
                function _getDefVal($context, $name) {
                        $key = $context . '_' . $name;
                }
                function _getDefVal($context, $name) {
                        $key = $context . '_' . $name;
                                                $meta = NucleusPlugin::getOptionMeta($o->oextra);
 
                                                // if the option is readonly or hidden it may not be saved
                                                $meta = NucleusPlugin::getOptionMeta($o->oextra);
 
                                                // if the option is readonly or hidden it may not be saved
-                                               if (($meta['access'] != 'readonly') && ($meta['access'] != 'hidden')) {
+                                               if ((@$meta['access'] != 'readonly') && (@$meta['access'] != 'hidden')) {
 
                                                        $value = undoMagic($value);     // value comes from request
 
 
                                                        $value = undoMagic($value);     // value comes from request
 
                                                        }
 
                                                        // check the validity of numerical options
                                                        }
 
                                                        // check the validity of numerical options
-                                                       if (($meta['datatype'] == 'numerical') && (!is_numeric($value))) {
+                                                       if ((@$meta['datatype'] == 'numerical') && (!is_numeric($value))) {
                                                                //the option must be numeric, but the it isn't
                                                                //use the default for this option
                                                                $value = $o->odef;
                                                                //the option must be numeric, but the it isn't
                                                                //use the default for this option
                                                                $value = $o->odef;
 
                                                        // delete the old value for the option
                                                        sql_query('DELETE FROM '.sql_table('plugin_option').' WHERE oid='.intval($oid).' AND ocontextid='.intval($contextid));
 
                                                        // delete the old value for the option
                                                        sql_query('DELETE FROM '.sql_table('plugin_option').' WHERE oid='.intval($oid).' AND ocontextid='.intval($contextid));
-                                                       @mysql_query('INSERT INTO '.sql_table('plugin_option')." (oid, ocontextid, ovalue) VALUES (".intval($oid).",".intval($contextid).",'" . addslashes($value) . "')");
+                                                       sql_query('INSERT INTO '.sql_table('plugin_option')." (oid, ocontextid, ovalue) VALUES (".intval($oid).",".intval($contextid).",'" . addslashes($value) . "')");
                                                }
                                        }
                                }
                                                }
                                        }
                                }
-                       }
-                       // clear option value cache if the plugin object is already loaded
-                       if (is_object($o)) {
-                               $plugin=& $manager->pidLoaded($o->opid);
-                               if ($plugin) $plugin->clearOptionValueCache();
+                               // clear option value cache if the plugin object is already loaded
+                               if (is_object($o)) {
+                                       $plugin=& $manager->pidLoaded($o->opid);
+                                       if ($plugin) $plugin->clearOptionValueCache();
+                               }
                        }
                }
                        }
                }
-
        }
 ?>
        }
 ?>
index 15832d8..ac940fa 100755 (executable)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: PLUGINADMIN.php,v 1.8 2007-03-22 03:30:14 kmorimatsu Exp $
- * $NucleusJP: PLUGINADMIN.php,v 1.7 2007/02/06 09:00:24 kimitake Exp $
+ * @version $Id: PLUGINADMIN.php,v 1.9 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: PLUGINADMIN.php,v 1.8.2.2 2007/10/23 22:48:56 kmorimatsu Exp $
  */
 
 global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES, $HTTP_SESSION_VARS;
  */
 
 global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES, $HTTP_SESSION_VARS;
@@ -141,7 +141,7 @@ for (i=0;document.forms[i];i++){
       else document.forms[i].action+='&'+'ticket=<?php echo $ticket; ?>';
       continue;
     }
       else document.forms[i].action+='&'+'ticket=<?php echo $ticket; ?>';
       continue;
     }
-    document.write('<p><b>Error occured druing automatic addition of tickets.</b></p>');
+    document.write('<p><b>Error occured during automatic addition of tickets.</b></p>');
     j=document.forms[i].outerHTML;
     while (j!=j.replace('<','&lt;')) j=j.replace('<','&lt;');
     document.write('<p>'+j+'</p>');
     j=document.forms[i].outerHTML;
     while (j!=j.replace('<','&lt;')) j=j.replace('<','&lt;');
     document.write('<p>'+j+'</p>');
index 126233a..612b500 100755 (executable)
@@ -9,14 +9,13 @@
  * of the License, or (at your option) any later version.
  * (see nucleus/documentation/index.html#license for more info)
  */
  * of the License, or (at your option) any later version.
  * (see nucleus/documentation/index.html#license for more info)
  */
-
 /**
  * Class representing a skin
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
 /**
  * Class representing a skin
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: SKIN.php,v 1.8 2007-03-20 19:31:29 kmorimatsu Exp $
- * @version $NucleusJP: SKIN.php,v 1.7 2007/02/04 06:28:46 kimitake Exp $
+ * @version $Id: SKIN.php,v 1.9 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: SKIN.php,v 1.8.2.1 2007/09/05 07:45:01 kimitake Exp $
  */
 
 if ( !function_exists('requestVar') ) exit;
  */
 
 if ( !function_exists('requestVar') ) exit;
index b455b5f..5968f06 100755 (executable)
@@ -16,8 +16,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: backup.php,v 1.8 2007-02-19 22:27:59 kmorimatsu Exp $
- * $NucleusJP: backup.php,v 1.7 2007/02/04 06:28:46 kimitake Exp $
+ * @version $Id: backup.php,v 1.9 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: backup.php,v 1.8.2.1 2007/08/08 05:23:31 kimitake Exp $
  */
 
 
  */
 
 
@@ -217,20 +217,20 @@ function _backup_dump_structure($tablename) {
  */
 function _backup_get_field_names($result, $num_fields) {
 
  */
 function _backup_get_field_names($result, $num_fields) {
 
-       if (function_exists('mysqli_fetch_fields') ) {
+/*     if (function_exists('mysqli_fetch_fields') ) {
                
                $fields = mysqli_fetch_fields($result);
                for ($j = 0; $j < $num_fields; $j++)
                        $fields[$j] = $fields[$j]->name;
 
                
                $fields = mysqli_fetch_fields($result);
                for ($j = 0; $j < $num_fields; $j++)
                        $fields[$j] = $fields[$j]->name;
 
-       } else {
+       } else {*/
 
                $fields = array();
                for ($j = 0; $j < $num_fields; $j++) {
                        $fields[] = mysql_field_name($result, $j);
                }
 
 
                $fields = array();
                for ($j = 0; $j < $num_fields; $j++) {
                        $fields[] = mysql_field_name($result, $j);
                }
 
-       }
+/*     }*/
        
        return '(' . implode(', ', $fields) . ')';      
 }
        
        return '(' . implode(', ', $fields) . ')';      
 }
index 35f0022..6100e4a 100755 (executable)
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: globalfunctions.php,v 1.23 2007-04-09 23:21:34 kmorimatsu Exp $
- * $NucleusJP: globalfunctions.php,v 1.22 2007/04/06 22:08:39 kmorimatsu Exp $
+ * @version $Id: globalfunctions.php,v 1.24 2008-02-08 09:31:22 kimitake Exp $
+ * $NucleusJP: globalfunctions.php,v 1.23.2.7 2008/02/05 08:30:08 kimitake Exp $
  */
 
 // needed if we include globalfunctions from install.php
 global $nucleus, $CONF, $DIR_LIBS, $DIR_LANG, $manager, $member;
 
  */
 
 // needed if we include globalfunctions from install.php
 global $nucleus, $CONF, $DIR_LIBS, $DIR_LANG, $manager, $member;
 
-//$nucleus['version'] = 'v3.3SVN';
-//$nucleus['codename'] = 'Lithium';
-$nucleus['version'] = 'v3.3';
+$nucleus['version'] = 'v3.4';
 $nucleus['codename'] = '';
 
 checkVars(array('nucleus', 'CONF', 'DIR_LIBS', 'MYSQL_HOST', 'MYSQL_USER', 'MYSQL_PASSWORD', 'MYSQL_DATABASE', 'DIR_LANG', 'DIR_PLUGINS', 'HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_ENV_VARS', 'HTTP_SESSION_VARS', 'HTTP_POST_FILES', 'HTTP_SERVER_VARS', 'GLOBALS', 'argv', 'argc', '_GET', '_POST', '_COOKIE', '_ENV', '_SESSION', '_SERVER', '_FILES'));
 $nucleus['codename'] = '';
 
 checkVars(array('nucleus', 'CONF', 'DIR_LIBS', 'MYSQL_HOST', 'MYSQL_USER', 'MYSQL_PASSWORD', 'MYSQL_DATABASE', 'DIR_LANG', 'DIR_PLUGINS', 'HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_ENV_VARS', 'HTTP_SESSION_VARS', 'HTTP_POST_FILES', 'HTTP_SERVER_VARS', 'GLOBALS', 'argv', 'argc', '_GET', '_POST', '_COOKIE', '_ENV', '_SESSION', '_SERVER', '_FILES'));
@@ -36,7 +34,7 @@ if ($CONF['debug']) {
 
 // Avoid notices
 if (!isset($CONF['Self'])) {
 
 // Avoid notices
 if (!isset($CONF['Self'])) {
-       $CONF['Self'] = $_SERVER['PHP_SELF'];
+       $CONF['Self'] = htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES);
 }
 
 /*
 }
 
 /*
@@ -196,7 +194,7 @@ if ($action == 'login') {
        $login = postVar('login');
        $pw = postVar('password');
        $shared = intPostVar('shared'); // shared computer or not
        $login = postVar('login');
        $pw = postVar('password');
        $shared = intPostVar('shared'); // shared computer or not
-       
+
        $pw=substr($pw,0,40); // avoid md5 collision by using a long key
 
        if ($member->login($login, $pw) ) {
        $pw=substr($pw,0,40); // avoid md5 collision by using a long key
 
        if ($member->login($login, $pw) ) {
@@ -465,7 +463,7 @@ function intCookieVar($name) {
   * returns the currently used version (100 = 1.00, 101 = 1.01, etc...)
   */
 function getNucleusVersion() {
   * returns the currently used version (100 = 1.00, 101 = 1.01, etc...)
   */
 function getNucleusVersion() {
-       return 330;
+       return 340;
 }
 
 /**
 }
 
 /**
@@ -786,7 +784,7 @@ function selector() {
 //             if ($blogid && (intval($blogid) != $obj->iblog) ) {
 //                     doError(_ERROR_NOSUCHITEM);
 //             }
 //             if ($blogid && (intval($blogid) != $obj->iblog) ) {
 //                     doError(_ERROR_NOSUCHITEM);
 //             }
-               if ($blogid && (intval($blogid) != $obj->iblog)) {
+               if ($blogid && (intval($blogid) != $obj->iblog) ) {
                        if (!headers_sent()) {
                                $b =& $manager->getBlog($obj->iblog);
                                $CONF['ItemURL'] = $b->getURL();
                        if (!headers_sent()) {
                                $b =& $manager->getBlog($obj->iblog);
                                $CONF['ItemURL'] = $b->getURL();
@@ -843,20 +841,20 @@ function selector() {
 
                // get next and prev month links ...
                global $archivenext, $archiveprev, $archivetype, $archivenextexists, $archiveprevexists;
 
                // get next and prev month links ...
                global $archivenext, $archiveprev, $archivetype, $archivenextexists, $archiveprevexists;
-
+               
                // sql queries for the timestamp of the first and the last published item
                // sql queries for the timestamp of the first and the last published item
-               $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 ORDER BY itime ASC";
-               $first_timestamp=quickQuery ($query); 
-               $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 ORDER BY itime DESC";
-               $last_timestamp=quickQuery ($query); 
+               $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 AND iblog=".(int)($blogid ? $blogid : $CONF['DefaultBlog'])." ORDER BY itime ASC";
+               $first_timestamp=quickQuery ($query);
+               $query = "SELECT UNIX_TIMESTAMP(itime) as result FROM ".sql_table('item')." WHERE idraft=0 AND iblog=".(int)($blogid ? $blogid : $CONF['DefaultBlog'])." ORDER BY itime DESC";
+               $last_timestamp=quickQuery ($query);
 
                sscanf($archive, '%d-%d-%d', $y, $m, $d);
 
                if ($d != 0) {
                        $archivetype = _ARCHIVETYPE_DAY;
                        $t = mktime(0, 0, 0, $m, $d, $y);
 
                sscanf($archive, '%d-%d-%d', $y, $m, $d);
 
                if ($d != 0) {
                        $archivetype = _ARCHIVETYPE_DAY;
                        $t = mktime(0, 0, 0, $m, $d, $y);
-
-                       $archiveprev = strftime('%Y-%m-%d', $t - (24 * 60 * 60) );
+                       // one day has 24 * 60 * 60 = 86400 seconds                     
+                       $archiveprev = strftime('%Y-%m-%d', $t - 86400 );
                        // check for published items                    
                        if ($t > $first_timestamp) {
                                $archiveprevexists = true;
                        // check for published items                    
                        if ($t > $first_timestamp) {
                                $archiveprevexists = true;
@@ -864,31 +862,29 @@ function selector() {
                        else {
                                $archiveprevexists = false;
                        }
                        else {
                                $archiveprevexists = false;
                        }
-
+                       
                        // one day later
                        // one day later
-//                     $t += 86400; 
-//                     $archivenext = strftime('%Y-%m-%d', $t);
-                       $archivenext = strftime('%Y-%m-%d', $t + (24 * 60 * 60) );
-                       if ($t + (24 * 60 * 60) < $last_timestamp) {
+                       $t += 86400; 
+                       $archivenext = strftime('%Y-%m-%d', $t);
+                       if ($t < $last_timestamp) {
                                $archivenextexists = true;
                        }
                        else {
                                $archivenextexists = false;
                        }
                                $archivenextexists = true;
                        }
                        else {
                                $archivenextexists = false;
                        }
-
+                       
                } else {
                        $archivetype = _ARCHIVETYPE_MONTH;
                        $t = mktime(0, 0, 0, $m, 1, $y);
                } else {
                        $archivetype = _ARCHIVETYPE_MONTH;
                        $t = mktime(0, 0, 0, $m, 1, $y);
-
-                       $archiveprev = strftime('%Y-%m', $t - (1 * 24 * 60 * 60) );
+                       // one day before is in the previous month
+                       $archiveprev = strftime('%Y-%m', $t - 86400);
                        if ($t > $first_timestamp) {
                                $archiveprevexists = true;
                        }
                        else {
                                $archiveprevexists = false;
                        }
                        if ($t > $first_timestamp) {
                                $archiveprevexists = true;
                        }
                        else {
                                $archiveprevexists = false;
                        }
-
-//                     $archivenext = strftime('%Y-%m', $t + (32 * 24 * 60 * 60) );
+                       
                        // timestamp for the next month                 
                        $t = mktime(0, 0, 0, $m+1, 1, $y);
                        $archivenext = strftime('%Y-%m', $t);
                        // timestamp for the next month                 
                        $t = mktime(0, 0, 0, $m+1, 1, $y);
                        $archivenext = strftime('%Y-%m', $t);
@@ -992,6 +988,9 @@ function selector() {
 
        // parse the skin
        $skin->parse($type);
 
        // parse the skin
        $skin->parse($type);
+
+       // check to see we should throw JustPosted event
+       $blog->checkJustPosted();
 }
 
 /**
 }
 
 /**
@@ -1793,7 +1792,7 @@ function sanitizeArray(&$array)
                if (!in_array($key, $excludeListForSanitization)) {
                                
                        // check value
                if (!in_array($key, $excludeListForSanitization)) {
                                
                        // check value
-                       list($val, $tmp) = explode('\\', $val);
+                       @list($val, $tmp) = explode('\\', $val);
                        
                        // remove control code etc.
                        $val = strtr($val, "\0\r\n<>'\"", "       ");
                        
                        // remove control code etc.
                        $val = strtr($val, "\0\r\n<>'\"", "       ");
@@ -1961,7 +1960,7 @@ function getBookmarklet($blogid) {
        $document = 'document';
        $bookmarkletline = "javascript:Q='';x=".$document.";y=window;if(x.selection){Q=x.selection.createRange().text;}else if(y.getSelection){Q=y.getSelection();}else if(x.getSelection){Q=x.getSelection();}wingm=window.open('";
        $bookmarkletline .= $CONF['AdminURL'] . "bookmarklet.php?blogid=$blogid";
        $document = 'document';
        $bookmarkletline = "javascript:Q='';x=".$document.";y=window;if(x.selection){Q=x.selection.createRange().text;}else if(y.getSelection){Q=y.getSelection();}else if(x.getSelection){Q=x.getSelection();}wingm=window.open('";
        $bookmarkletline .= $CONF['AdminURL'] . "bookmarklet.php?blogid=$blogid";
-       $bookmarkletline .="&logtext='+escape(Q)+'&loglink='+escape(x.location.href)+'&loglinktitle='+escape(x.title),'nucleusbm','scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes');wingm.focus();";
+       $bookmarkletline .="&logtext='+escape(Q)+'&loglink='+escape(x.location.href)+'&loglinktitle='+escape(x.title),'nucleusbm','scrollbars=yes,width=600,height=550,left=10,top=10,status=yes,resizable=yes');wingm.focus();";
 
        return $bookmarkletline;
 }
 
        return $bookmarkletline;
 }
@@ -1981,4 +1980,17 @@ function ifset(&$var) {
        return null;
 }
 
        return null;
 }
 
-?>
\ No newline at end of file
+/**
+ * Returns number of subscriber to an event
+ *
+ * @param event
+ * @return number of subscriber(s)
+ */
+function numberOfEventSubscriber($event) {
+       $query = 'SELECT COUNT(*) as count FROM ' . sql_table('plugin_event') . ' WHERE event=\'' . $event . '\'';
+       $res = sql_query($query);
+       $obj = mysql_fetch_object($res);
+       return $obj->count;
+}
+
+?>
index 78ba2b7..372e101 100644 (file)
@@ -14,8 +14,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: showlist.php,v 1.7 2007-04-19 06:26:15 kimitake Exp $
- * @version $NucleusJP: showlist.php,v 1.6 2007/03/19 10:21:21 shizuki Exp $
+ * @version $Id: showlist.php,v 1.8 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: showlist.php,v 1.7.2.3 2007/12/03 00:01:48 kmorimatsu Exp $
  */
 
 
  */
 
 
@@ -249,7 +249,7 @@ function listplug_plugOptionRow($current) {
        $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
 
        // only if it is not a hidden option write the controls to the page
        $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
 
        // only if it is not a hidden option write the controls to the page
-       if ($meta['access'] != 'hidden') {
+       if (@$meta['access'] != 'hidden') {
                echo '<td>',htmlspecialchars($current['description']?$current['description']:$current['name']),'</td>';
                echo '<td>';
                switch($current['type']) {
                echo '<td>',htmlspecialchars($current['description']?$current['description']:$current['name']),'</td>';
                echo '<td>';
                switch($current['type']) {
@@ -274,7 +274,7 @@ function listplug_plugOptionRow($current) {
                        case 'textarea':
                                //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
                                echo '<textarea class="pluginoption" cols="30" rows="5" name="',htmlspecialchars($varname),'"';
                        case 'textarea':
                                //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
                                echo '<textarea class="pluginoption" cols="30" rows="5" name="',htmlspecialchars($varname),'"';
-                               if ($meta['access'] == 'readonly') {
+                               if (@$meta['access'] == 'readonly') {
                                        echo ' readonly="readonly"';
                                }
                                echo '>',htmlspecialchars($current['value']),'</textarea>';
                                        echo ' readonly="readonly"';
                                }
                                echo '>',htmlspecialchars($current['value']),'</textarea>';
@@ -284,15 +284,15 @@ function listplug_plugOptionRow($current) {
                                //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
 
                                echo '<input type="text" size="40" maxlength="128" name="',htmlspecialchars($varname),'" value="',htmlspecialchars($current['value']),'"';
                                //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
 
                                echo '<input type="text" size="40" maxlength="128" name="',htmlspecialchars($varname),'" value="',htmlspecialchars($current['value']),'"';
-                               if ($meta['datatype'] == 'numerical') {
+                               if (@$meta['datatype'] == 'numerical') {
                                        echo ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
                                }
                                        echo ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
                                }
-                               if ($meta['access'] == 'readonly') {
+                               if (@$meta['access'] == 'readonly') {
                                        echo ' readonly="readonly"';
                                }
                                echo ' />';
                }
                                        echo ' readonly="readonly"';
                                }
                                echo ' />';
                }
-               echo $current['extra'];
+               echo @$current['extra'];
                echo '</td>';
        }
 }
                echo '</td>';
        }
 }
index 7793ce4..2e37bd0 100755 (executable)
@@ -15,8 +15,8 @@
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
  *
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: skinie.php,v 1.9 2007-04-20 08:43:25 kimitake Exp $
- * @version $NucleusJP: skinie.php,v 1.8 2007/03/22 03:30:14 kmorimatsu Exp $
+ * @version $Id: skinie.php,v 1.10 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: skinie.php,v 1.9.2.1 2007/09/05 07:46:30 kimitake Exp $
  */
 
 class SKINIMPORT {
  */
 
 class SKINIMPORT {
index 915a7ca..c4ea1a0 100755 (executable)
@@ -13,8 +13,8 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: vars4.0.6.php,v 1.10 2007-02-04 06:28:46 kimitake Exp $
- * @version $NucleusJP: vars4.0.6.php,v 1.9 2006/12/18 20:30:48 kmorimatsu Exp $
+ * @version $Id: vars4.0.6.php,v 1.11 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: vars4.0.6.php,v 1.10.2.1 2007/09/05 07:46:30 kimitake Exp $
  */
 
 /**
  */
 
 /**
index 42f5814..906b198 100755 (executable)
@@ -13,8 +13,8 @@
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
 /**
  * @license http://nucleuscms.org/license.txt GNU General Public License
  * @copyright Copyright (C) 2002-2007 The Nucleus Group
- * @version $Id: vars4.1.0.php,v 1.11 2007-10-30 18:47:03 kmorimatsu Exp $
- * @version $NucleusJP: vars4.1.0.php,v 1.10 2007/02/04 06:28:46 kimitake Exp $
+ * @version $Id: vars4.1.0.php,v 1.12 2008-02-08 09:31:22 kimitake Exp $
+ * @version $NucleusJP: vars4.1.0.php,v 1.10.2.2 2007/10/30 19:01:33 kmorimatsu Exp $
  */
 
 
  */
 
 
index ced24c1..a589e20 100755 (executable)
@@ -1,8 +1,9 @@
-<?php                                  // -*-c++-*-
+<?php
 // by Edd Dumbill (C) 1999-2002
 // <edd@usefulinc.com>
 // by Edd Dumbill (C) 1999-2002
 // <edd@usefulinc.com>
-// $Id: xmlrpc.inc.php,v 1.6 2006-07-12 07:11:47 kimitake Exp $
-// $NucleusJP: xmlrpc.inc.php,v 1.5 2005/08/13 07:24:44 kimitake Exp $
+// $Original: xmlrpc.inc,v 1.158 2007/03/01 21:21:02 ggiunta Exp $
+// $Id: xmlrpc.inc.php,v 1.7 2008-02-08 09:31:22 kimitake Exp $
+// $NucleusJP: xmlrpc.inc.php,v 1.6.2.2 2007/09/07 07:04:24 kimitake Exp $
 
 
 // Copyright (c) 1999,2000,2002 Edd Dumbill.
 
 
 // Copyright (c) 1999,2000,2002 Edd Dumbill.
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 // OF THE POSSIBILITY OF SUCH DAMAGE.
 
 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 // OF THE POSSIBILITY OF SUCH DAMAGE.
 
-       if (!function_exists('xml_parser_create'))
+       if(!function_exists('xml_parser_create'))
        {
        {
-               // Win 32 fix. From: 'Leo West' <lwest@imaginet.fr>
-               if($WINDIR)
+               // For PHP 4 onward, XML functionality is always compiled-in on windows:
+               // no more need to dl-open it. It might have been compiled out on *nix...
+               if(strtoupper(substr(PHP_OS, 0, 3) != 'WIN'))
                {
                {
-                       dl('php3_xml.dll');
+                       dl('xml.so');
                }
                }
-               else
+       }
+
+       // Try to be backward compat with php < 4.2 (are we not being nice ?)
+       $phpversion = phpversion();
+       if($phpversion[0] == '4' && $phpversion[2] < 2)
+       {
+               // give an opportunity to user to specify where to include other files from
+               if(!defined('PHP_XMLRPC_COMPAT_DIR'))
                {
                {
-                       dl('xml.so');
+                       define('PHP_XMLRPC_COMPAT_DIR',dirname(__FILE__).'/compat/');
+               }
+               if($phpversion[2] == '0')
+               {
+                       if($phpversion[4] < 6)
+                       {
+                               include(PHP_XMLRPC_COMPAT_DIR.'is_callable.php');
+                       }
+                       include(PHP_XMLRPC_COMPAT_DIR.'is_scalar.php');
+                       include(PHP_XMLRPC_COMPAT_DIR.'array_key_exists.php');
+                       include(PHP_XMLRPC_COMPAT_DIR.'version_compare.php');
                }
                }
+               include(PHP_XMLRPC_COMPAT_DIR.'var_export.php');
+               include(PHP_XMLRPC_COMPAT_DIR.'is_a.php');
        }
 
        // G. Giunta 2005/01/29: declare global these variables,
        // so that xmlrpc.inc will work even if included from within a function
        }
 
        // G. Giunta 2005/01/29: declare global these variables,
        // so that xmlrpc.inc will work even if included from within a function
-       // NB: it will give warnings in PHP3, so we comment it out
-       // Milosch: Next round, maybe we should explicitly request these via $GLOBALS where used.
-       if (phpversion() >= '4')
-       {
-               global $xmlrpcI4;
-               global $xmlrpcInt;
-               global $xmlrpcDouble;
-               global $xmlrpcBoolean;
-               global $xmlrpcString;
-               global $xmlrpcDateTime;
-               global $xmlrpcBase64;
-               global $xmlrpcArray;
-               global $xmlrpcStruct;
-
-               global $xmlrpcTypes;
-               global $xmlEntities;
-               global $xmlrpcerr;
-               global $xmlrpcstr;
-               global $xmlrpc_defencoding;
-               global $xmlrpc_internalencoding;
-               global $xmlrpcName;
-               global $xmlrpcVersion;
-               global $xmlrpcerruser;
-               global $xmlrpcerrxml;
-               global $xmlrpc_backslash;
-               global $_xh;
-       }
-       $xmlrpcI4='i4';
-       $xmlrpcInt='int';
-       $xmlrpcBoolean='boolean';
-       $xmlrpcDouble='double';
-       $xmlrpcString='string';
-       $xmlrpcDateTime='dateTime.iso8601';
-       $xmlrpcBase64='base64';
-       $xmlrpcArray='array';
-       $xmlrpcStruct='struct';
-
-       $xmlrpcTypes=array(
-               $xmlrpcI4       => 1,
-               $xmlrpcInt      => 1,
-               $xmlrpcBoolean  => 1,
-               $xmlrpcString   => 1,
-               $xmlrpcDouble   => 1,
-               $xmlrpcDateTime => 1,
-               $xmlrpcBase64   => 1,
-               $xmlrpcArray    => 2,
-               $xmlrpcStruct   => 3
+       // Milosch: 2005/08/07 - explicitly request these via $GLOBALS where used.
+       $GLOBALS['xmlrpcI4']='i4';
+       $GLOBALS['xmlrpcInt']='int';
+       $GLOBALS['xmlrpcBoolean']='boolean';
+       $GLOBALS['xmlrpcDouble']='double';
+       $GLOBALS['xmlrpcString']='string';
+       $GLOBALS['xmlrpcDateTime']='dateTime.iso8601';
+       $GLOBALS['xmlrpcBase64']='base64';
+       $GLOBALS['xmlrpcArray']='array';
+       $GLOBALS['xmlrpcStruct']='struct';
+       $GLOBALS['xmlrpcValue']='undefined';
+
+       $GLOBALS['xmlrpcTypes']=array(
+               $GLOBALS['xmlrpcI4']       => 1,
+               $GLOBALS['xmlrpcInt']      => 1,
+               $GLOBALS['xmlrpcBoolean']  => 1,
+               $GLOBALS['xmlrpcString']   => 1,
+               $GLOBALS['xmlrpcDouble']   => 1,
+               $GLOBALS['xmlrpcDateTime'] => 1,
+               $GLOBALS['xmlrpcBase64']   => 1,
+               $GLOBALS['xmlrpcArray']    => 2,
+               $GLOBALS['xmlrpcStruct']   => 3
        );
 
        );
 
-       $xmlrpc_valid_parents = array(
-               'BOOLEAN' => array('VALUE' => 'VALUE'),
-               'I4' => array('VALUE' => 'VALUE'),
-               'INT' => array('VALUE' => 'VALUE'),
-               'STRING' => array('VALUE' => 'VALUE'),
-               'DOUBLE' => array('VALUE' => 'VALUE'),
-               'DATETIME.ISO8601' => array('VALUE' => 'VALUE'),
-               'BASE64' => array('VALUE' => 'VALUE'),
-               'ARRAY' => array('VALUE' => 'VALUE'),
-               'STRUCT' => array('VALUE' => 'VALUE'),
-               'PARAM' => array('PARAMS' => 'PARAMS'),
-               'METHODNAME' => array('METHODCALL' => 'METHODCALL'),
-               'PARAMS' => array('METHODCALL' => 'METHODCALL', 'METHODRESPONSE' => 'METHODRESPONSE'),
-               'MEMBER' => array('STRUCT' => 'STRUCT'),
-               'NAME' => array('MEMBER' => 'MEMBER'),
-               'DATA' => array('ARRAY' => 'ARRAY'),
-               'FAULT' => array('METHODRESPONSE' => 'METHODRESPONSE'),
-               'VALUE' => array('MEMBER' => 'MEMBER', 'DATA' => 'DATA', 'PARAM' => 'PARAM', 'FAULT' => 'FAULT')
+       $GLOBALS['xmlrpc_valid_parents'] = array(
+               'VALUE' => array('MEMBER', 'DATA', 'PARAM', 'FAULT'),
+               'BOOLEAN' => array('VALUE'),
+               'I4' => array('VALUE'),
+               'INT' => array('VALUE'),
+               'STRING' => array('VALUE'),
+               'DOUBLE' => array('VALUE'),
+               'DATETIME.ISO8601' => array('VALUE'),
+               'BASE64' => array('VALUE'),
+               'MEMBER' => array('STRUCT'),
+               'NAME' => array('MEMBER'),
+               'DATA' => array('ARRAY'),
+               'ARRAY' => array('VALUE'),
+               'STRUCT' => array('VALUE'),
+               'PARAM' => array('PARAMS'),
+               'METHODNAME' => array('METHODCALL'),
+               'PARAMS' => array('METHODCALL', 'METHODRESPONSE'),
+               'FAULT' => array('METHODRESPONSE'),
+               'NIL' => array('VALUE') // only used when extension activated
        );
 
        );
 
-       $xmlEntities=array(
+       // define extra types for supporting NULL (useful for json or <NIL/>)
+       $GLOBALS['xmlrpcNull']='null';
+       $GLOBALS['xmlrpcTypes']['null']=1;
+
+       // Not in use anymore since 2.0. Shall we remove it?
+       /// @deprecated
+       $GLOBALS['xmlEntities']=array(
                'amp'  => '&',
                'quot' => '"',
                'lt'   => '<',
                'amp'  => '&',
                'quot' => '"',
                'lt'   => '<',
                'apos' => "'"
        );
 
                'apos' => "'"
        );
 
-       $xmlrpcerr['unknown_method']=1;
-       $xmlrpcstr['unknown_method']='Unknown method';
-       $xmlrpcerr['invalid_return']=2;
-       $xmlrpcstr['invalid_return']='Invalid return payload: enable debugging to examine incoming payload';
-       $xmlrpcerr['incorrect_params']=3;
-       $xmlrpcstr['incorrect_params']='Incorrect parameters passed to method';
-       $xmlrpcerr['introspect_unknown']=4;
-       $xmlrpcstr['introspect_unknown']="Can't introspect: method unknown";
-       $xmlrpcerr['http_error']=5;
-       $xmlrpcstr['http_error']="Didn't receive 200 OK from remote server.";
-       $xmlrpcerr['no_data']=6;
-       $xmlrpcstr['no_data']='No data received from server.';
-       $xmlrpcerr['no_ssl']=7;
-       $xmlrpcstr['no_ssl']='No SSL support compiled in.';
-       $xmlrpcerr['curl_fail']=8;
-       $xmlrpcstr['curl_fail']='CURL error';
-       $xmlrpcerr['invalid_request']=15;
-       $xmlrpcstr['invalid_request']='Invalid request payload';
-
-       $xmlrpcerr['multicall_notstruct'] = 9;
-       $xmlrpcstr['multicall_notstruct'] = 'system.multicall expected struct';
-       $xmlrpcerr['multicall_nomethod']  = 10;
-       $xmlrpcstr['multicall_nomethod']  = 'missing methodName';
-       $xmlrpcerr['multicall_notstring'] = 11;
-       $xmlrpcstr['multicall_notstring'] = 'methodName is not a string';
-       $xmlrpcerr['multicall_recursion'] = 12;
-       $xmlrpcstr['multicall_recursion'] = 'recursive system.multicall forbidden';
-       $xmlrpcerr['multicall_noparams']  = 13;
-       $xmlrpcstr['multicall_noparams']  = 'missing params';
-       $xmlrpcerr['multicall_notarray']  = 14;
-       $xmlrpcstr['multicall_notarray']  = 'params is not an array';
-
-       // The charset encoding expected by the server for received messages and
-       // by the client for received responses
-       $xmlrpc_defencoding='UTF-8';
-       // The encoding used by PHP.
-       // String values received will be converted to this.
-       $xmlrpc_internalencoding='ISO-8859-1';
-
-       $xmlrpcName='XML-RPC for PHP';
-       $xmlrpcVersion='1.2.1';
+       // tables used for transcoding different charsets into us-ascii xml
+
+       $GLOBALS['xml_iso88591_Entities']=array();
+       $GLOBALS['xml_iso88591_Entities']['in'] = array();
+       $GLOBALS['xml_iso88591_Entities']['out'] = array();
+       for ($i = 0; $i < 32; $i++)
+       {
+               $GLOBALS['xml_iso88591_Entities']['in'][] = chr($i);
+               $GLOBALS['xml_iso88591_Entities']['out'][] = '&#'.$i.';';
+       }
+       for ($i = 160; $i < 256; $i++)
+       {
+               $GLOBALS['xml_iso88591_Entities']['in'][] = chr($i);
+               $GLOBALS['xml_iso88591_Entities']['out'][] = '&#'.$i.';';
+       }
+
+       /// @todo add to iso table the characters from cp_1252 range, i.e. 128 to 159.
+       /// These will NOT be present in true ISO-8859-1, but will save the unwary
+       /// windows user from sending junk.
+/*
+$cp1252_to_xmlent =
+  array(
+   '\x80'=>'&#x20AC;', '\x81'=>'?', '\x82'=>'&#x201A;', '\x83'=>'&#x0192;',
+   '\x84'=>'&#x201E;', '\x85'=>'&#x2026;', '\x86'=>'&#x2020;', \x87'=>'&#x2021;',
+   '\x88'=>'&#x02C6;', '\x89'=>'&#x2030;', '\x8A'=>'&#x0160;', '\x8B'=>'&#x2039;',
+   '\x8C'=>'&#x0152;', '\x8D'=>'?', '\x8E'=>'&#x017D;', '\x8F'=>'?',
+   '\x90'=>'?', '\x91'=>'&#x2018;', '\x92'=>'&#x2019;', '\x93'=>'&#x201C;',
+   '\x94'=>'&#x201D;', '\x95'=>'&#x2022;', '\x96'=>'&#x2013;', '\x97'=>'&#x2014;',
+   '\x98'=>'&#x02DC;', '\x99'=>'&#x2122;', '\x9A'=>'&#x0161;', '\x9B'=>'&#x203A;',
+   '\x9C'=>'&#x0153;', '\x9D'=>'?', '\x9E'=>'&#x017E;', '\x9F'=>'&#x0178;'
+  );
+*/
+
+       $GLOBALS['xmlrpcerr']['unknown_method']=1;
+       $GLOBALS['xmlrpcstr']['unknown_method']='Unknown method';
+       $GLOBALS['xmlrpcerr']['invalid_return']=2;
+       $GLOBALS['xmlrpcstr']['invalid_return']='Invalid return payload: enable debugging to examine incoming payload';
+       $GLOBALS['xmlrpcerr']['incorrect_params']=3;
+       $GLOBALS['xmlrpcstr']['incorrect_params']='Incorrect parameters passed to method';
+       $GLOBALS['xmlrpcerr']['introspect_unknown']=4;
+       $GLOBALS['xmlrpcstr']['introspect_unknown']="Can't introspect: method unknown";
+       $GLOBALS['xmlrpcerr']['http_error']=5;
+       $GLOBALS['xmlrpcstr']['http_error']="Didn't receive 200 OK from remote server.";
+       $GLOBALS['xmlrpcerr']['no_data']=6;
+       $GLOBALS['xmlrpcstr']['no_data']='No data received from server.';
+       $GLOBALS['xmlrpcerr']['no_ssl']=7;
+       $GLOBALS['xmlrpcstr']['no_ssl']='No SSL support compiled in.';
+       $GLOBALS['xmlrpcerr']['curl_fail']=8;
+       $GLOBALS['xmlrpcstr']['curl_fail']='CURL error';
+       $GLOBALS['xmlrpcerr']['invalid_request']=15;
+       $GLOBALS['xmlrpcstr']['invalid_request']='Invalid request payload';
+       $GLOBALS['xmlrpcerr']['no_curl']=16;
+       $GLOBALS['xmlrpcstr']['no_curl']='No CURL support compiled in.';
+       $GLOBALS['xmlrpcerr']['server_error']=17;
+       $GLOBALS['xmlrpcstr']['server_error']='Internal server error';
+       $GLOBALS['xmlrpcerr']['multicall_error']=18;
+       $GLOBALS['xmlrpcstr']['multicall_error']='Received from server invalid multicall response';
+
+       $GLOBALS['xmlrpcerr']['multicall_notstruct'] = 9;
+       $GLOBALS['xmlrpcstr']['multicall_notstruct'] = 'system.multicall expected struct';
+       $GLOBALS['xmlrpcerr']['multicall_nomethod']  = 10;
+       $GLOBALS['xmlrpcstr']['multicall_nomethod']  = 'missing methodName';
+       $GLOBALS['xmlrpcerr']['multicall_notstring'] = 11;
+       $GLOBALS['xmlrpcstr']['multicall_notstring'] = 'methodName is not a string';
+       $GLOBALS['xmlrpcerr']['multicall_recursion'] = 12;
+       $GLOBALS['xmlrpcstr']['multicall_recursion'] = 'recursive system.multicall forbidden';
+       $GLOBALS['xmlrpcerr']['multicall_noparams']  = 13;
+       $GLOBALS['xmlrpcstr']['multicall_noparams']  = 'missing params';
+       $GLOBALS['xmlrpcerr']['multicall_notarray']  = 14;
+       $GLOBALS['xmlrpcstr']['multicall_notarray']  = 'params is not an array';
+
+       $GLOBALS['xmlrpcerr']['cannot_decompress']=103;
+       $GLOBALS['xmlrpcstr']['cannot_decompress']='Received from server compressed HTTP and cannot decompress';
+       $GLOBALS['xmlrpcerr']['decompress_fail']=104;
+       $GLOBALS['xmlrpcstr']['decompress_fail']='Received from server invalid compressed HTTP';
+       $GLOBALS['xmlrpcerr']['dechunk_fail']=105;
+       $GLOBALS['xmlrpcstr']['dechunk_fail']='Received from server invalid chunked HTTP';
+       $GLOBALS['xmlrpcerr']['server_cannot_decompress']=106;
+       $GLOBALS['xmlrpcstr']['server_cannot_decompress']='Received from client compressed HTTP request and cannot decompress';
+       $GLOBALS['xmlrpcerr']['server_decompress_fail']=107;
+       $GLOBALS['xmlrpcstr']['server_decompress_fail']='Received from client invalid compressed HTTP request';
+
+       // The charset encoding used by the server for received messages and
+       // by the client for received responses when received charset cannot be determined
+       // or is not supported
+       $GLOBALS['xmlrpc_defencoding']='UTF-8';
+
+       // The encoding used internally by PHP.
+       // String values received as xml will be converted to this, and php strings will be converted to xml
+       // as if having been coded with this
+       $GLOBALS['xmlrpc_internalencoding']='ISO-8859-1';
+
+       $GLOBALS['xmlrpcName']='XML-RPC for PHP';
+       $GLOBALS['xmlrpcVersion']='2.2';
 
        // let user errors start at 800
 
        // let user errors start at 800
-       $xmlrpcerruser=800;
+       $GLOBALS['xmlrpcerruser']=800;
        // let XML parse errors start at 100
        // let XML parse errors start at 100
-       $xmlrpcerrxml=100;
+       $GLOBALS['xmlrpcerrxml']=100;
 
        // formulate backslashes for escaping regexp
 
        // formulate backslashes for escaping regexp
-       $xmlrpc_backslash=chr(92).chr(92);
+       // Not in use anymore since 2.0. Shall we remove it?
+       /// @deprecated
+       $GLOBALS['xmlrpc_backslash']=chr(92).chr(92);
+
+       // set to TRUE to enable correct decoding of <NIL/> values
+       $GLOBALS['xmlrpc_null_extension']=false;
 
        // used to store state during parsing
        // quick explanation of components:
        //   ac - used to accumulate values
 
        // used to store state during parsing
        // quick explanation of components:
        //   ac - used to accumulate values
-       //   isf - used to indicate a fault
+       //   isf - used to indicate a parsing fault (2) or xmlrpcresp fault (1)
+       //   isf_reason - used for storing xmlrpcresp fault string
        //   lv - used to indicate "looking for a value": implements
        //        the logic to allow values with no types to be strings
        //   params - used to store parameters in method calls
        //   method - used to store method name
        //   stack - array with genealogy of xml elements names:
        //           used to validate nesting of xmlrpc elements
        //   lv - used to indicate "looking for a value": implements
        //        the logic to allow values with no types to be strings
        //   params - used to store parameters in method calls
        //   method - used to store method name
        //   stack - array with genealogy of xml elements names:
        //           used to validate nesting of xmlrpc elements
-
-       $_xh=array();
+       $GLOBALS['_xh']=null;
 
        /**
 
        /**
+       * Convert a string to the correct XML representation in a target charset
        * To help correct communication of non-ascii chars inside strings, regardless
        * of the charset used when sending requests, parsing them, sending responses
        * To help correct communication of non-ascii chars inside strings, regardless
        * of the charset used when sending requests, parsing them, sending responses
-       * and parsing responses, convert all non-ascii chars present in the message
+       * and parsing responses, an option is to convert all non-ascii chars present in the message
        * into their equivalent 'charset entity'. Charset entities enumerated this way
        * are independent of the charset encoding used to transmit them, and all XML
        * parsers are bound to understand them.
        * into their equivalent 'charset entity'. Charset entities enumerated this way
        * are independent of the charset encoding used to transmit them, and all XML
        * parsers are bound to understand them.
+       * Note that in the std case we are not sending a charset encoding mime type
+       * along with http headers, so we are bound by RFC 3023 to emit strict us-ascii.
+       *
+       * @todo do a bit of basic benchmarking (strtr vs. str_replace)
+       * @todo make usage of iconv() or recode_string() or mb_string() where available
        */
        */
-       function xmlrpc_entity_decode($string)
+       function xmlrpc_encode_entitites($data, $src_encoding='', $dest_encoding='')
        {
        {
-               $top=split('&', $string);
-               $op='';
-               $i=0;
-               while($i<sizeof($top))
+               if ($src_encoding == '')
                {
                {
-                       if (ereg("^([#a-zA-Z0-9]+);", $top[$i], $regs))
-                       {
-                               $op.=ereg_replace("^[#a-zA-Z0-9]+;",
-                               xmlrpc_lookup_entity($regs[1]),
-                               $top[$i]);
-                       }
-                       else
-                       {
-                               if ($i==0)
-                               {
-                                       $op=$top[$i];
-                               }
-                               else
-                               {
-                                       $op.='&' . $top[$i];
-                               }
-                       }
-                       $i++;
+                       // lame, but we know no better...
+                       $src_encoding = $GLOBALS['xmlrpc_internalencoding'];
                }
                }
-               return $op;
-       }
 
 
-       function xmlrpc_lookup_entity($ent)
-       {
-               global $xmlEntities;
-
-               if (isset($xmlEntities[strtolower($ent)]))
-               {
-                       return $xmlEntities[strtolower($ent)];
-               }
-               if (ereg("^#([0-9]+)$", $ent, $regs))
+               switch(strtoupper($src_encoding.'_'.$dest_encoding))
                {
                {
-                       return chr($regs[1]);
-               }
-               return '?';
-       }
-
-       /**
-        * These entities originate from HTML specs (1.1, proposed 2.0, etc),
-        * and are taken directly from php-4.3.1/ext/mbstring/html_entities.c.
-        * Until php provides functionality to translate these entities in its
-        * core library, use this function.
-        */
-       function xmlrpc_html_entity_xlate($data = '')
-       {
-               $entities = array(
-                       "&nbsp;" => "&#160;",
-                       "&iexcl;" => "&#161;",
-                       "&cent;" => "&#162;",
-                       "&pound;" => "&#163;",
-                       "&curren;" => "&#164;",
-                       "&yen;" => "&#165;",
-                       "&brvbar;" => "&#166;",
-                       "&sect;" => "&#167;",
-                       "&uml;" => "&#168;",
-                       "&copy;" => "&#169;",
-                       "&ordf;" => "&#170;",
-                       "&laquo;" => "&#171;",
-                       "&not;" => "&#172;",
-                       "&shy;" => "&#173;",
-                       "&reg;" => "&#174;",
-                       "&macr;" => "&#175;",
-                       "&deg;" => "&#176;",
-                       "&plusmn;" => "&#177;",
-                       "&sup2;" => "&#178;",
-                       "&sup3;" => "&#179;",
-                       "&acute;" => "&#180;",
-                       "&micro;" => "&#181;",
-                       "&para;" => "&#182;",
-                       "&middot;" => "&#183;",
-                       "&cedil;" => "&#184;",
-                       "&sup1;" => "&#185;",
-                       "&ordm;" => "&#186;",
-                       "&raquo;" => "&#187;",
-                       "&frac14;" => "&#188;",
-                       "&frac12;" => "&#189;",
-                       "&frac34;" => "&#190;",
-                       "&iquest;" => "&#191;",
-                       "&Agrave;" => "&#192;",
-                       "&Aacute;" => "&#193;",
-                       "&Acirc;" => "&#194;",
-                       "&Atilde;" => "&#195;",
-                       "&Auml;" => "&#196;",
-                       "&Aring;" => "&#197;",
-                       "&AElig;" => "&#198;",
-                       "&Ccedil;" => "&#199;",
-                       "&Egrave;" => "&#200;",
-                       "&Eacute;" => "&#201;",
-                       "&Ecirc;" => "&#202;",
-                       "&Euml;" => "&#203;",
-                       "&Igrave;" => "&#204;",
-                       "&Iacute;" => "&#205;",
-                       "&Icirc;" => "&#206;",
-                       "&Iuml;" => "&#207;",
-                       "&ETH;" => "&#208;",
-                       "&Ntilde;" => "&#209;",
-                       "&Ograve;" => "&#210;",
-                       "&Oacute;" => "&#211;",
-                       "&Ocirc;" => "&#212;",
-                       "&Otilde;" => "&#213;",
-                       "&Ouml;" => "&#214;",
-                       "&times;" => "&#215;",
-                       "&Oslash;" => "&#216;",
-                       "&Ugrave;" => "&#217;",
-                       "&Uacute;" => "&#218;",
-                       "&Ucirc;" => "&#219;",
-                       "&Uuml;" => "&#220;",
-                       "&Yacute;" => "&#221;",
-                       "&THORN;" => "&#222;",
-                       "&szlig;" => "&#223;",
-                       "&agrave;" => "&#224;",
-                       "&aacute;" => "&#225;",
-                       "&acirc;" => "&#226;",
-                       "&atilde;" => "&#227;",
-                       "&auml;" => "&#228;",
-                       "&aring;" => "&#229;",
-                       "&aelig;" => "&#230;",
-                       "&ccedil;" => "&#231;",
-                       "&egrave;" => "&#232;",
-                       "&eacute;" => "&#233;",
-                       "&ecirc;" => "&#234;",
-                       "&euml;" => "&#235;",
-                       "&igrave;" => "&#236;",
-                       "&iacute;" => "&#237;",
-                       "&icirc;" => "&#238;",
-                       "&iuml;" => "&#239;",
-                       "&eth;" => "&#240;",
-                       "&ntilde;" => "&#241;",
-                       "&ograve;" => "&#242;",
-                       "&oacute;" => "&#243;",
-                       "&ocirc;" => "&#244;",
-                       "&otilde;" => "&#245;",
-                       "&ouml;" => "&#246;",
-                       "&divide;" => "&#247;",
-                       "&oslash;" => "&#248;",
-                       "&ugrave;" => "&#249;",
-                       "&uacute;" => "&#250;",
-                       "&ucirc;" => "&#251;",
-                       "&uuml;" => "&#252;",
-                       "&yacute;" => "&#253;",
-                       "&thorn;" => "&#254;",
-                       "&yuml;" => "&#255;",
-                       "&OElig;" => "&#338;",
-                       "&oelig;" => "&#339;",
-                       "&Scaron;" => "&#352;",
-                       "&scaron;" => "&#353;",
-                       "&Yuml;" => "&#376;",
-                       "&fnof;" => "&#402;",
-                       "&circ;" => "&#710;",
-                       "&tilde;" => "&#732;",
-                       "&Alpha;" => "&#913;",
-                       "&Beta;" => "&#914;",
-                       "&Gamma;" => "&#915;",
-                       "&Delta;" => "&#916;",
-                       "&Epsilon;" => "&#917;",
-                       "&Zeta;" => "&#918;",
-                       "&Eta;" => "&#919;",
-                       "&Theta;" => "&#920;",
-                       "&Iota;" => "&#921;",
-                       "&Kappa;" => "&#922;",
-                       "&Lambda;" => "&#923;",
-                       "&Mu;" => "&#924;",
-                       "&Nu;" => "&#925;",
-                       "&Xi;" => "&#926;",
-                       "&Omicron;" => "&#927;",
-                       "&Pi;" => "&#928;",
-                       "&Rho;" => "&#929;",
-                       "&Sigma;" => "&#931;",
-                       "&Tau;" => "&#932;",
-                       "&Upsilon;" => "&#933;",
-                       "&Phi;" => "&#934;",
-                       "&Chi;" => "&#935;",
-                       "&Psi;" => "&#936;",
-                       "&Omega;" => "&#937;",
-                       "&beta;" => "&#946;",
-                       "&gamma;" => "&#947;",
-                       "&delta;" => "&#948;",
-                       "&epsilon;" => "&#949;",
-                       "&zeta;" => "&#950;",
-                       "&eta;" => "&#951;",
-                       "&theta;" => "&#952;",
-                       "&iota;" => "&#953;",
-                       "&kappa;" => "&#954;",
-                       "&lambda;" => "&#955;",
-                       "&mu;" => "&#956;",
-                       "&nu;" => "&#957;",
-                       "&xi;" => "&#958;",
-                       "&omicron;" => "&#959;",
-                       "&pi;" => "&#960;",
-                       "&rho;" => "&#961;",
-                       "&sigmaf;" => "&#962;",
-                       "&sigma;" => "&#963;",
-                       "&tau;" => "&#964;",
-                       "&upsilon;" => "&#965;",
-                       "&phi;" => "&#966;",
-                       "&chi;" => "&#967;",
-                       "&psi;" => "&#968;",
-                       "&omega;" => "&#969;",
-                       "&thetasym;" => "&#977;",
-                       "&upsih;" => "&#978;",
-                       "&piv;" => "&#982;",
-                       "&ensp;" => "&#8194;",
-                       "&emsp;" => "&#8195;",
-                       "&thinsp;" => "&#8201;",
-                       "&zwnj;" => "&#8204;",
-                       "&zwj;" => "&#8205;",
-                       "&lrm;" => "&#8206;",
-                       "&rlm;" => "&#8207;",
-                       "&ndash;" => "&#8211;",
-                       "&mdash;" => "&#8212;",
-                       "&lsquo;" => "&#8216;",
-                       "&rsquo;" => "&#8217;",
-                       "&sbquo;" => "&#8218;",
-                       "&ldquo;" => "&#8220;",
-                       "&rdquo;" => "&#8221;",
-                       "&bdquo;" => "&#8222;",
-                       "&dagger;" => "&#8224;",
-                       "&Dagger;" => "&#8225;",
-                       "&bull;" => "&#8226;",
-                       "&hellip;" => "&#8230;",
-                       "&permil;" => "&#8240;",
-                       "&prime;" => "&#8242;",
-                       "&Prime;" => "&#8243;",
-                       "&lsaquo;" => "&#8249;",
-                       "&rsaquo;" => "&#8250;",
-                       "&oline;" => "&#8254;",
-                       "&frasl;" => "&#8260;",
-                       "&euro;" => "&#8364;",
-                       "&weierp;" => "&#8472;",
-                       "&image;" => "&#8465;",
-                       "&real;" => "&#8476;",
-                       "&trade;" => "&#8482;",
-                       "&alefsym;" => "&#8501;",
-                       "&larr;" => "&#8592;",
-                       "&uarr;" => "&#8593;",
-                       "&rarr;" => "&#8594;",
-                       "&darr;" => "&#8595;",
-                       "&harr;" => "&#8596;",
-                       "&crarr;" => "&#8629;",
-                       "&lArr;" => "&#8656;",
-                       "&uArr;" => "&#8657;",
-                       "&rArr;" => "&#8658;",
-                       "&dArr;" => "&#8659;",
-                       "&hArr;" => "&#8660;",
-                       "&forall;" => "&#8704;",
-                       "&part;" => "&#8706;",
-                       "&exist;" => "&#8707;",
-                       "&empty;" => "&#8709;",
-                       "&nabla;" => "&#8711;",
-                       "&isin;" => "&#8712;",
-                       "&notin;" => "&#8713;",
-                       "&ni;" => "&#8715;",
-                       "&prod;" => "&#8719;",
-                       "&sum;" => "&#8721;",
-                       "&minus;" => "&#8722;",
-                       "&lowast;" => "&#8727;",
-                       "&radic;" => "&#8730;",
-                       "&prop;" => "&#8733;",
-                       "&infin;" => "&#8734;",
-                       "&ang;" => "&#8736;",
-                       "&and;" => "&#8743;",
-                       "&or;" => "&#8744;",
-                       "&cap;" => "&#8745;",
-                       "&cup;" => "&#8746;",
-                       "&int;" => "&#8747;",
-                       "&there4;" => "&#8756;",
-                       "&sim;" => "&#8764;",
-                       "&cong;" => "&#8773;",
-                       "&asymp;" => "&#8776;",
-                       "&ne;" => "&#8800;",
-                       "&equiv;" => "&#8801;",
-                       "&le;" => "&#8804;",
-                       "&ge;" => "&#8805;",
-                       "&sub;" => "&#8834;",
-                       "&sup;" => "&#8835;",
-                       "&nsub;" => "&#8836;",
-                       "&sube;" => "&#8838;",
-                       "&supe;" => "&#8839;",
-                       "&oplus;" => "&#8853;",
-                       "&otimes;" => "&#8855;",
-                       "&perp;" => "&#8869;",
-                       "&sdot;" => "&#8901;",
-                       "&lceil;" => "&#8968;",
-                       "&rceil;" => "&#8969;",
-                       "&lfloor;" => "&#8970;",
-                       "&rfloor;" => "&#8971;",
-                       "&lang;" => "&#9001;",
-                       "&rang;" => "&#9002;",
-                       "&loz;" => "&#9674;",
-                       "&spades;" => "&#9824;",
-                       "&clubs;" => "&#9827;",
-                       "&hearts;" => "&#9829;",
-                       "&diams;" => "&#9830;");
-               return strtr($data, $entities);
-       }
-
-       function xmlrpc_encode_entitites($data) 
+                       case 'ISO-8859-1_':
+                       case 'ISO-8859-1_US-ASCII':
+                               $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&amp;', '&quot;', '&apos;', '&lt;', '&gt;'), $data);
+                               $escaped_data = str_replace($GLOBALS['xml_iso88591_Entities']['in'], $GLOBALS['xml_iso88591_Entities']['out'], $escaped_data);
+                               break;
+                       case 'ISO-8859-1_UTF-8':
+                               $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&amp;', '&quot;', '&apos;', '&lt;', '&gt;'), $data);
+                               $escaped_data = utf8_encode($escaped_data);
+                               break;
+                       case 'ISO-8859-1_ISO-8859-1':
+                       case 'US-ASCII_US-ASCII':
+                       case 'US-ASCII_UTF-8':
+                       case 'US-ASCII_':
+                       case 'US-ASCII_ISO-8859-1':
+                       case 'UTF-8_UTF-8':
+                               $escaped_data = str_replace(array('&', '"', "'", '<', '>'), array('&amp;', '&quot;', '&apos;', '&lt;', '&gt;'), $data);
+                               break;
+                       case 'UTF-8_':
+                       case 'UTF-8_US-ASCII':
+                       case 'UTF-8_ISO-8859-1':
+       // NB: this will choke on invalid UTF-8, going most likely beyond EOF
+       $escaped_data = '';
+       // be kind to users creating string xmlrpcvals out of different php types
+       $data = (string) $data;
+       $ns = strlen ($data);
+       for ($nn = 0; $nn < $ns; $nn++)
        {
        {
-               $length = strlen($data);
-               $escapeddata = "";
-               for($position = 0; $position < $length; $position++)
+               $ch = $data[$nn];
+               $ii = ord($ch);
+               //1 7 0bbbbbbb (127)
+               if ($ii < 128)
                {
                {
-                       $character = substr($data, $position, 1);
-                       $code = Ord($character);
-                       switch($code) {
+                       /// @todo shall we replace this with a (supposedly) faster str_replace?
+                       switch($ii){
                                case 34:
                                case 34:
-                               $character = "&quot;";
-                               break;
+                                       $escaped_data .= '&quot;';
+                                       break;
                                case 38:
                                case 38:
-                               $character = "&amp;";
-                               break;
+                                       $escaped_data .= '&amp;';
+                                       break;
                                case 39:
                                case 39:
-                               $character = "&apos;";
-                               break;
+                                       $escaped_data .= '&apos;';
+                                       break;
                                case 60:
                                case 60:
-                               $character = "&lt;";
-                               break;
+                                       $escaped_data .= '&lt;';
+                                       break;
                                case 62:
                                case 62:
-                               $character = "&gt;";
-                               break;
+                                       $escaped_data .= '&gt;';
+                                       break;
                                default:
                                default:
-                               if ($code < 32 || $code > 159)
-                                       $character = ("&#".strval($code).";");
+                                       $escaped_data .= $ch;
+                       } // switch
+               }
+               //2 11 110bbbbb 10bbbbbb (2047)
+               else if ($ii>>5 == 6)
+               {
+                       $b1 = ($ii & 31);
+                       $ii = ord($data[$nn+1]);
+                       $b2 = ($ii & 63);
+                       $ii = ($b1 * 64) + $b2;
+                       $ent = sprintf ('&#%d;', $ii);
+                       $escaped_data .= $ent;
+                       $nn += 1;
+               }
+               //3 16 1110bbbb 10bbbbbb 10bbbbbb
+               else if ($ii>>4 == 14)
+               {
+                       $b1 = ($ii & 31);
+                       $ii = ord($data[$nn+1]);
+                       $b2 = ($ii & 63);
+                       $ii = ord($data[$nn+2]);
+                       $b3 = ($ii & 63);
+                       $ii = ((($b1 * 64) + $b2) * 64) + $b3;
+                       $ent = sprintf ('&#%d;', $ii);
+                       $escaped_data .= $ent;
+                       $nn += 2;
+               }
+               //4 21 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+               else if ($ii>>3 == 30)
+               {
+                       $b1 = ($ii & 31);
+                       $ii = ord($data[$nn+1]);
+                       $b2 = ($ii & 63);
+                       $ii = ord($data[$nn+2]);
+                       $b3 = ($ii & 63);
+                       $ii = ord($data[$nn+3]);
+                       $b4 = ($ii & 63);
+                       $ii = ((((($b1 * 64) + $b2) * 64) + $b3) * 64) + $b4;
+                       $ent = sprintf ('&#%d;', $ii);
+                       $escaped_data .= $ent;
+                       $nn += 3;
+               }
+       }
                                break;
                                break;
-                       }
-                       $escapeddata .= $character;
+                       default:
+                               $escaped_data = '';
+                               error_log("Converting from $src_encoding to $dest_encoding: not supported...");
                }
                }
-               return $escapeddata;
+               return $escaped_data;
        }
 
        }
 
-       function xmlrpc_se($parser, $name, $attrs)
+       /// xml parser handler function for opening element tags
+       function xmlrpc_se($parser, $name, $attrs, $accept_single_vals=false)
        {
        {
-               global $_xh, $xmlrpcDateTime, $xmlrpcString, $xmlrpc_valid_parents;
-
                // if invalid xmlrpc already detected, skip all processing
                // if invalid xmlrpc already detected, skip all processing
-               if ($_xh[$parser]['isf'] < 2)
-               {
-
-               // check for correct element nesting
-               // top level element can only be of 2 types
-               if ($_xh[$parser]['sp'] == 0)
+               if ($GLOBALS['_xh']['isf'] < 2)
                {
                {
-                       if ($name != 'METHODRESPONSE' && $name != 'METHODCALL')
+                       // check for correct element nesting
+                       // top level element can only be of 2 types
+                       /// @todo optimization creep: save this check into a bool variable, instead of using count() every time:
+                       ///       there is only a single top level element in xml anyway
+                       if (count($GLOBALS['_xh']['stack']) == 0)
                        {
                        {
-                               $_xh[$parser]['isf'] = 2;
-                               $_xh[$parser]['isf_reason'] = 'missing top level xmlrpc element';
-                               return;
+                               if ($name != 'METHODRESPONSE' && $name != 'METHODCALL' && (
+                                       $name != 'VALUE' && !$accept_single_vals))
+                               {
+                                       $GLOBALS['_xh']['isf'] = 2;
+                                       $GLOBALS['_xh']['isf_reason'] = 'missing top level xmlrpc element';
+                                       return;
+                               }
+                               else
+                               {
+                                       $GLOBALS['_xh']['rt'] = strtolower($name);
+                               }
                        }
                        }
-               }
-               else
-               {
-                       // not top level element: see if parent is OK
-                       $parent = $_xh[$parser]['stack'][$_xh[$parser]['sp']-1];
-                       if (!isset($xmlrpc_valid_parents[$name][$parent]))
+                       else
                        {
                        {
-                               $_xh[$parser]['isf'] = 2;
-                               $_xh[$parser]['isf_reason'] = "xmlrpc element $name cannot be child of $parent";
-                               return;
-                       }
-               }
-
-               switch($name)
-               {
-                       case 'STRUCT':
-                       case 'ARRAY':
-                               //$_xh[$parser]['st'].='array(';
-                               //$_xh[$parser]['cm']++;
-                               // this last line turns quoting off
-                               // this means if we get an empty array we'll
-                               // simply get a bit of whitespace in the eval
-                               //$_xh[$parser]['qt']=0;
-
-                               // create an empty array to hold child values, and push it onto appropriate stack
-                               $cur_val = array();
-                               $cur_val['values'] = array();
-                               $cur_val['type'] = $name;
-                               $_xh[$parser]['valuestack'][$_xh[$parser]['vsp']] = $cur_val;
-                               $_xh[$parser]['vsp']++;
-                               break;
-                       case 'METHODNAME':
-                       case 'NAME':
-                               //$_xh[$parser]['st'].='"';
-                               $_xh[$parser]['ac']='';
-                               break;
-                       case 'FAULT':
-                               $_xh[$parser]['isf']=1;
-                               break;
-                       case 'PARAM':
-                               //$_xh[$parser]['st']='';
-                               // clear value, so we can check later if no value will passed for this param/member
-                               $_xh[$parser]['value']='';
-                               break;
-                       case 'VALUE':
-                               //$_xh[$parser]['st'].='new xmlrpcval(';
-                               // look for a value: if this is still true by the
-                               // time we reach the end tag for value then the type is string
-                               // by implication
-                               $_xh[$parser]['vt']='value';
-                               $_xh[$parser]['ac']='';
-                               //$_xh[$parser]['qt']=0;
-                               $_xh[$parser]['lv']=1;
-                               break;
-                       case 'I4':
-                       case 'INT':
-                       case 'STRING':
-                       case 'BOOLEAN':
-                       case 'DOUBLE':
-                       case 'DATETIME.ISO8601':
-                       case 'BASE64':
-                               if ($_xh[$parser]['vt']!='value')
-                               {
-                                       //two data elements inside a value: an error occurred!
-                                       $_xh[$parser]['isf'] = 2;
-                                       $_xh[$parser]['isf_reason'] = "$name element following a {$_xh[$parser]['vt']} element inside a single value";
+                               // not top level element: see if parent is OK
+                               $parent = end($GLOBALS['_xh']['stack']);
+                               if (!array_key_exists($name, $GLOBALS['xmlrpc_valid_parents']) || !in_array($parent, $GLOBALS['xmlrpc_valid_parents'][$name]))
+                               {
+                                       $GLOBALS['_xh']['isf'] = 2;
+                                       $GLOBALS['_xh']['isf_reason'] = "xmlrpc element $name cannot be child of $parent";
                                        return;
                                }
                                        return;
                                }
+                       }
 
 
-                               // reset the accumulator
-                               $_xh[$parser]['ac']='';
-
-                               /*if ($name=='DATETIME.ISO8601' || $name=='STRING')
-                               {
-                                       $_xh[$parser]['qt']=1;
-                                       if ($name=='DATETIME.ISO8601')
+                       switch($name)
+                       {
+                               // optimize for speed switch cases: most common cases first
+                               case 'VALUE':
+                                       /// @todo we could check for 2 VALUE elements inside a MEMBER or PARAM element
+                                       $GLOBALS['_xh']['vt']='value'; // indicator: no value found yet
+                                       $GLOBALS['_xh']['ac']='';
+                                       $GLOBALS['_xh']['lv']=1;
+                                       $GLOBALS['_xh']['php_class']=null;
+                                       break;
+                               case 'I4':
+                               case 'INT':
+                               case 'STRING':
+                               case 'BOOLEAN':
+                               case 'DOUBLE':
+                               case 'DATETIME.ISO8601':
+                               case 'BASE64':
+                                       if ($GLOBALS['_xh']['vt']!='value')
                                        {
                                        {
-                                               $_xh[$parser]['vt']=$xmlrpcDateTime;
+                                               //two data elements inside a value: an error occurred!
+                                               $GLOBALS['_xh']['isf'] = 2;
+                                               $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value";
+                                               return;
                                        }
                                        }
-                               }
-                               elseif ($name=='BASE64')
-                               {
-                                       $_xh[$parser]['qt']=2;
-                               }
-                               else
-                               {
-                                       // No quoting is required here -- but
-                                       // at the end of the element we must check
-                                       // for data format errors.
-                                       $_xh[$parser]['qt']=0;
-                               }*/
-                               break;
-                       case 'MEMBER':
-                               //$_xh[$parser]['ac']='';
-                               // avoid warnings later on if no NAME is found before VALUE inside
-                               // a struct member predefining member name as NULL
-                               $_xh[$parser]['valuestack'][$_xh[$parser]['vsp']-1]['name'] = '';
-                               // clear value, so we can check later if no value will passed for this param/member
-                               $_xh[$parser]['value']='';
-                               break;
-                       case 'DATA':
-                       case 'METHODCALL':
-                       case 'METHODRESPONSE':
-                       case 'PARAMS':
-                               // valid elements that add little to processing
-                               break;
-                       default:
-                               /// INVALID ELEMENT: RAISE ISF so that it is later recognized!!!
-                               $_xh[$parser]['isf'] = 2;
-                               $_xh[$parser]['isf_reason'] = "found not-xmlrpc xml element $name";
-                               break;
-               }
+                                       $GLOBALS['_xh']['ac']=''; // reset the accumulator
+                                       break;
+                               case 'STRUCT':
+                               case 'ARRAY':
+                                       if ($GLOBALS['_xh']['vt']!='value')
+                                       {
+                                               //two data elements inside a value: an error occurred!
+                                               $GLOBALS['_xh']['isf'] = 2;
+                                               $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value";
+                                               return;
+                                       }
+                                       // create an empty array to hold child values, and push it onto appropriate stack
+                                       $cur_val = array();
+                                       $cur_val['values'] = array();
+                                       $cur_val['type'] = $name;
+                                       // check for out-of-band information to rebuild php objs
+                                       // and in case it is found, save it
+                                       if (@isset($attrs['PHP_CLASS']))
+                                       {
+                                               $cur_val['php_class'] = $attrs['PHP_CLASS'];
+                                       }
+                                       $GLOBALS['_xh']['valuestack'][] = $cur_val;
+                                       $GLOBALS['_xh']['vt']='data'; // be prepared for a data element next
+                                       break;
+                               case 'DATA':
+                                       if ($GLOBALS['_xh']['vt']!='data')
+                                       {
+                                               //two data elements inside a value: an error occurred!
+                                               $GLOBALS['_xh']['isf'] = 2;
+                                               $GLOBALS['_xh']['isf_reason'] = "found two data elements inside an array element";
+                                               return;
+                                       }
+                               case 'METHODCALL':
+                               case 'METHODRESPONSE':
+                               case 'PARAMS':
+                                       // valid elements that add little to processing
+                                       break;
+                               case 'METHODNAME':
+                               case 'NAME':
+                                       /// @todo we could check for 2 NAME elements inside a MEMBER element
+                                       $GLOBALS['_xh']['ac']='';
+                                       break;
+                               case 'FAULT':
+                                       $GLOBALS['_xh']['isf']=1;
+                                       break;
+                               case 'MEMBER':
+                                       $GLOBALS['_xh']['valuestack'][count($GLOBALS['_xh']['valuestack'])-1]['name']=''; // set member name to null, in case we do not find in the xml later on
+                                       //$GLOBALS['_xh']['ac']='';
+                                       // Drop trough intentionally
+                               case 'PARAM':
+                                       // clear value type, so we can check later if no value has been passed for this param/member
+                                       $GLOBALS['_xh']['vt']=null;
+                                       break;
+                               case 'NIL':
+                                       if ($GLOBALS['xmlrpc_null_extension'])
+                                       {
+                                               if ($GLOBALS['_xh']['vt']!='value')
+                                               {
+                                                       //two data elements inside a value: an error occurred!
+                                                       $GLOBALS['_xh']['isf'] = 2;
+                                                       $GLOBALS['_xh']['isf_reason'] = "$name element following a {$GLOBALS['_xh']['vt']} element inside a single value";
+                                                       return;
+                                               }
+                                               $GLOBALS['_xh']['ac']=''; // reset the accumulator
+                                               break;
+                                       }
+                                       // we do not support the <NIL/> extension, so
+                                       // drop through intentionally
+                               default:
+                                       /// INVALID ELEMENT: RAISE ISF so that it is later recognized!!!
+                                       $GLOBALS['_xh']['isf'] = 2;
+                                       $GLOBALS['_xh']['isf_reason'] = "found not-xmlrpc xml element $name";
+                                       break;
+                       }
 
 
-               // Save current element name to stack, to validate nesting
-               $_xh[$parser]['stack'][$_xh[$parser]['sp']] = $name;
-               $_xh[$parser]['sp']++;
+                       // Save current element name to stack, to validate nesting
+                       $GLOBALS['_xh']['stack'][] = $name;
 
 
-               if ($name!='VALUE')
-               {
-                       $_xh[$parser]['lv']=0;
+                       /// @todo optimization creep: move this inside the big switch() above
+                       if($name!='VALUE')
+                       {
+                               $GLOBALS['_xh']['lv']=0;
+                       }
                }
        }
                }
        }
-       }
 
 
-       function xmlrpc_ee($parser, $name)
+       /// Used in decoding xml chunks that might represent single xmlrpc values
+       function xmlrpc_se_any($parser, $name, $attrs)
        {
        {
-               global $_xh,$xmlrpcTypes,$xmlrpcString,$xmlrpcDateTime;
-
-               if ($_xh[$parser]['isf'] < 2)
-               {
+               xmlrpc_se($parser, $name, $attrs, true);
+       }
 
 
-               // push this element name from stack
-               // NB: if XML validates, correct opening/closing is guaranteed and
-               // we do not have to check for $name == $curr_elem.
-               // we also checked for proper nesting at start of elements...
-               $_xh[$parser]['sp']--;
-               $curr_elem = $_xh[$parser]['stack'][$_xh[$parser]['sp']];
-               unset($_xh[$parser]['stack'][$_xh[$parser]['sp']]); 
-               switch($name)
+       /// xml parser handler function for close element tags
+       function xmlrpc_ee($parser, $name, $rebuild_xmlrpcvals = true)
+       {
+               if ($GLOBALS['_xh']['isf'] < 2)
                {
                {
-                       case 'STRUCT':
-                       case 'ARRAY':
-                               //if ($_xh[$parser]['cm'] && substr($_xh[$parser]['st'], -1) ==',')
-                               //{
-                               //      $_xh[$parser]['st']=substr($_xh[$parser]['st'],0,-1);
-                               //}
-                               //$_xh[$parser]['st'].=')';
+                       // push this element name from stack
+                       // NB: if XML validates, correct opening/closing is guaranteed and
+                       // we do not have to check for $name == $curr_elem.
+                       // we also checked for proper nesting at start of elements...
+                       $curr_elem = array_pop($GLOBALS['_xh']['stack']);
 
 
-                               // fetch out of stack array of values, and promote it to current value
-                               $_xh[$parser]['vsp']--;
-                               $cur_val = $_xh[$parser]['valuestack'][$_xh[$parser]['vsp']];
-                               unset($_xh[$parser]['valuestack'][$_xh[$parser]['vsp']]);
-                               $_xh[$parser]['value'] = $cur_val['values'];
-
-                               $_xh[$parser]['vt']=strtolower($name);
-                               //$_xh[$parser]['cm']--;
-                               break;
-                       case 'NAME':
-                               //$_xh[$parser]['st'].= $_xh[$parser]['ac'] . '" => ';
-                               $_xh[$parser]['valuestack'][$_xh[$parser]['vsp']-1]['name'] = $_xh[$parser]['ac'];
-                               break;
-                       case 'BOOLEAN':
-                       case 'I4':
-                       case 'INT':
-                       case 'STRING':
-                       case 'DOUBLE':
-                       case 'DATETIME.ISO8601':
-                       case 'BASE64':
-                               $_xh[$parser]['vt']=strtolower($name);
-                               //if ($_xh[$parser]['qt']==1)                   
-                               if ($name=='STRING')
-                               {
-                                       // we use double quotes rather than single so backslashification works OK
-                                       //$_xh[$parser]['st'].='"'. $_xh[$parser]['ac'] . '"';
-                                       $_xh[$parser]['value']=$_xh[$parser]['ac'];
-                               }
-                               elseif ($name=='DATETIME.ISO8601')
-                               {
-                                       $_xh[$parser]['vt']=$xmlrpcDateTime;
-                                       $_xh[$parser]['value']=$_xh[$parser]['ac'];
-                               }
-                               elseif ($name=='BASE64')
-                               {
-                                       //$_xh[$parser]['st'].='base64_decode("'. $_xh[$parser]['ac'] . '")';
-
-                                       ///@todo check for failure of base64 decoding / catch warnings
-                                       $_xh[$parser]['value']=base64_decode($_xh[$parser]['ac']);
-                               }
-                               elseif ($name=='BOOLEAN')
-                               {
-                                       // special case here: we translate boolean 1 or 0 into PHP
-                                       // constants true or false
-                                       // NB: this simple checks helps a lot sanitizing input, ie no
-                                       // security problems around here
+                       switch($name)
+                       {
+                               case 'VALUE':
+                                       // This if() detects if no scalar was inside <VALUE></VALUE>
+                                       if ($GLOBALS['_xh']['vt']=='value')
+                                       {
+                                               $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];
+                                               $GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcString'];
+                                       }
 
 
-                                       // [MOD] S. Verberkt (Legolas) (13/02/2006 21:16): Also accept 'true' and 'false'
-                                       if ($_xh[$parser]['ac']=='1' || strcasecmp($_xh[$parser]['ac'], 'true') == 0)
+                                       if ($rebuild_xmlrpcvals)
                                        {
                                        {
-                                               //$_xh[$parser]['ac']='true';   
-                                               $_xh[$parser]['value']=true;
+                                               // build the xmlrpc val out of the data received, and substitute it
+                                               $temp =& new xmlrpcval($GLOBALS['_xh']['value'], $GLOBALS['_xh']['vt']);
+                                               // in case we got info about underlying php class, save it
+                                               // in the object we're rebuilding
+                                               if (isset($GLOBALS['_xh']['php_class']))
+                                                       $temp->_php_class = $GLOBALS['_xh']['php_class'];
+                                               // check if we are inside an array or struct:
+                                               // if value just built is inside an array, let's move it into array on the stack
+                                               $vscount = count($GLOBALS['_xh']['valuestack']);
+                                               if ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY')
+                                               {
+                                                       $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $temp;
+                                               }
+                                               else
+                                               {
+                                                       $GLOBALS['_xh']['value'] = $temp;
+                                               }
                                        }
                                        else
                                        {
                                        }
                                        else
                                        {
-                                               //$_xh[$parser]['ac']='false';
-                                               // log if receiveing something strange, even though we set the value to false anyway
-                                               if ($_xh[$parser]['ac']!='0' && strcasecmp($_xh[$parser]['ac'], 'false') != 0)
-                                                       error_log('XML-RPC: invalid value received in BOOLEAN: '.$_xh[$parser]['ac']);
-                                               $_xh[$parser]['value']=false;
-                                       }
-                                       // [/MOD]
+                                               /// @todo this needs to treat correctly php-serialized objects,
+                                               /// since std deserializing is done by php_xmlrpc_decode,
+                                               /// which we will not be calling...
+                                               if (isset($GLOBALS['_xh']['php_class']))
+                                               {
+                                               }
 
 
-                                       //$_xh[$parser]['st'].=$_xh[$parser]['ac'];
-                               }
-                               elseif ($name=='DOUBLE')
-                               {
-                                       // we have a DOUBLE
-                                       // we must check that only 0123456789-.<space> are characters here
-                                       if (!ereg("^[+-]?[eE0123456789 \\t\\.]+$", $_xh[$parser]['ac']))
+                                               // check if we are inside an array or struct:
+                                               // if value just built is inside an array, let's move it into array on the stack
+                                               $vscount = count($GLOBALS['_xh']['valuestack']);
+                                               if ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY')
+                                               {
+                                                       $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $GLOBALS['_xh']['value'];
+                                               }
+                                       }
+                                       break;
+                               case 'BOOLEAN':
+                               case 'I4':
+                               case 'INT':
+                               case 'STRING':
+                               case 'DOUBLE':
+                               case 'DATETIME.ISO8601':
+                               case 'BASE64':
+                                       $GLOBALS['_xh']['vt']=strtolower($name);
+                               /// @todo: optimization creep - remove the if/elseif cycle below
+                    /// since the case() in which we are already did that
+                                       if ($name=='STRING')
+                                       {
+                                               $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];
+                                       }
+                                       elseif ($name=='DATETIME.ISO8601')
+                                       {
+                                               if (!preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $GLOBALS['_xh']['ac']))
+                                               {
+                                                       error_log('XML-RPC: invalid value received in DATETIME: '.$GLOBALS['_xh']['ac']);
+                                               }
+                                               $GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcDateTime'];
+                                               $GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];
+                                       }
+                                       elseif ($name=='BASE64')
+                                       {
+                                               /// @todo check for failure of base64 decoding / catch warnings
+                                               $GLOBALS['_xh']['value']=base64_decode($GLOBALS['_xh']['ac']);
+                                       }
+                                       elseif ($name=='BOOLEAN')
+                                       {
+                                               // special case here: we translate boolean 1 or 0 into PHP
+                                               // constants true or false.
+                                               // Strings 'true' and 'false' are accepted, even though the
+                                               // spec never mentions them (see eg. Blogger api docs)
+                                               // NB: this simple checks helps a lot sanitizing input, ie no
+                                               // security problems around here
+                                               if ($GLOBALS['_xh']['ac']=='1' || strcasecmp($GLOBALS['_xh']['ac'], 'true') == 0)
+                                               {
+                                                       $GLOBALS['_xh']['value']=true;
+                                               }
+                                               else
+                                               {
+                                                       // log if receiveing something strange, even though we set the value to false anyway
+                                                       if ($GLOBALS['_xh']['ac']!='0' && strcasecmp($_xh[$parser]['ac'], 'false') != 0)
+                                                               error_log('XML-RPC: invalid value received in BOOLEAN: '.$GLOBALS['_xh']['ac']);
+                                                       $GLOBALS['_xh']['value']=false;
+                                               }
+                                       }
+                                       elseif ($name=='DOUBLE')
                                        {
                                        {
-                                               // TODO: find a better way of throwing an error
-                                               // than this!
-                                               error_log('XML-RPC: non numeric value received in DOUBLE: '.$_xh[$parser]['ac']);
-                                               //$_xh[$parser]['st'].="'ERROR_NON_NUMERIC_FOUND'";
-                                               $_xh[$parser]['value']='ERROR_NON_NUMERIC_FOUND';
+                                               // we have a DOUBLE
+                                               // we must check that only 0123456789-.<space> are characters here
+                                               if (!preg_match('/^[+-]?[eE0123456789 \t.]+$/', $GLOBALS['_xh']['ac']))
+                                               {
+                                                       /// @todo: find a better way of throwing an error
+                                                       // than this!
+                                                       error_log('XML-RPC: non numeric value received in DOUBLE: '.$GLOBALS['_xh']['ac']);
+                                                       $GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND';
+                                               }
+                                               else
+                                               {
+                                                       // it's ok, add it on
+                                                       $GLOBALS['_xh']['value']=(double)$GLOBALS['_xh']['ac'];
+                                               }
                                        }
                                        else
                                        {
                                        }
                                        else
                                        {
-                                               // it's ok, add it on
-                                               //$_xh[$parser]['st'].=(double)$_xh[$parser]['ac'];
-                                               $_xh[$parser]['value']=(double)$_xh[$parser]['ac'];
+                                               // we have an I4/INT
+                                               // we must check that only 0123456789-<space> are characters here
+                                               if (!preg_match('/^[+-]?[0123456789 \t]+$/', $GLOBALS['_xh']['ac']))
+                                               {
+                                                       /// @todo find a better way of throwing an error
+                                                       // than this!
+                                                       error_log('XML-RPC: non numeric value received in INT: '.$GLOBALS['_xh']['ac']);
+                                                       $GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND';
+                                               }
+                                               else
+                                               {
+                                                       // it's ok, add it on
+                                                       $GLOBALS['_xh']['value']=(int)$GLOBALS['_xh']['ac'];
+                                               }
                                        }
                                        }
-                               }
-                               else
-                               {
-                                       // we have an I4/INT
-                                       // we must check that only 0123456789-<space> are characters here
-                                       if (!ereg("^[+-]?[0123456789 \\t]+$", $_xh[$parser]['ac']))
+                                       //$GLOBALS['_xh']['ac']=''; // is this necessary?
+                                       $GLOBALS['_xh']['lv']=3; // indicate we've found a value
+                                       break;
+                               case 'NAME':
+                                       $GLOBALS['_xh']['valuestack'][count($GLOBALS['_xh']['valuestack'])-1]['name'] = $GLOBALS['_xh']['ac'];
+                                       break;
+                               case 'MEMBER':
+                                       //$GLOBALS['_xh']['ac']=''; // is this necessary?
+                                       // add to array in the stack the last element built,
+                                       // unless no VALUE was found
+                                       if ($GLOBALS['_xh']['vt'])
+                                       {
+                                               $vscount = count($GLOBALS['_xh']['valuestack']);
+                                               $GLOBALS['_xh']['valuestack'][$vscount-1]['values'][$GLOBALS['_xh']['valuestack'][$vscount-1]['name']] = $GLOBALS['_xh']['value'];
+                                       } else
+                                               error_log('XML-RPC: missing VALUE inside STRUCT in received xml');
+                                       break;
+                               case 'DATA':
+                                       //$GLOBALS['_xh']['ac']=''; // is this necessary?
+                                       $GLOBALS['_xh']['vt']=null; // reset this to check for 2 data elements in a row - even if they're empty
+                                       break;
+                               case 'STRUCT':
+                               case 'ARRAY':
+                                       // fetch out of stack array of values, and promote it to current value
+                                       $curr_val = array_pop($GLOBALS['_xh']['valuestack']);
+                                       $GLOBALS['_xh']['value'] = $curr_val['values'];
+                                       $GLOBALS['_xh']['vt']=strtolower($name);
+                                       if (isset($curr_val['php_class']))
                                        {
                                        {
-                                               // TODO: find a better way of throwing an error
-                                               // than this!
-                                               error_log('XML-RPC: non numeric value received in INT: '.$_xh[$parser]['ac']);
-                                               //$_xh[$parser]['st'].="'ERROR_NON_NUMERIC_FOUND'";
-                                               $_xh[$parser]['value']='ERROR_NON_NUMERIC_FOUND';
+                                               $GLOBALS['_xh']['php_class'] = $curr_val['php_class'];
+                                       }
+                                       break;
+                               case 'PARAM':
+                                       // add to array of params the current value,
+                                       // unless no VALUE was found
+                                       if ($GLOBALS['_xh']['vt'])
+                                       {
+                                               $GLOBALS['_xh']['params'][]=$GLOBALS['_xh']['value'];
+                                               $GLOBALS['_xh']['pt'][]=$GLOBALS['_xh']['vt'];
                                        }
                                        else
                                        }
                                        else
+                                               error_log('XML-RPC: missing VALUE inside PARAM in received xml');
+                                       break;
+                               case 'METHODNAME':
+                                       $GLOBALS['_xh']['method']=preg_replace('/^[\n\r\t ]+/', '', $GLOBALS['_xh']['ac']);
+                                       break;
+                               case 'NIL':
+                                       if ($GLOBALS['xmlrpc_null_extension'])
                                        {
                                        {
-                                               // it's ok, add it on
-                                               //$_xh[$parser]['st'].=(int)$_xh[$parser]['ac'];
-                                               $_xh[$parser]['value']=(int)$_xh[$parser]['ac'];
+                                               $GLOBALS['_xh']['vt']='null';
+                                               $GLOBALS['_xh']['value']=null;
+                                               $GLOBALS['_xh']['lv']=3;
+                                               break;
                                        }
                                        }
-                               }
-                               $_xh[$parser]['ac']='';
-                               //$_xh[$parser]['qt']=0;
-                               $_xh[$parser]['lv']=3; // indicate we've found a value
-                               break;
-                       case 'VALUE':
-                               // This if() detects if no scalar was inside <VALUE></VALUE>
-                               if ($_xh[$parser]['vt']=='value')
-                               {
-                                       $_xh[$parser]['value']=$_xh[$parser]['ac'];
-                                       $_xh[$parser]['vt']=$xmlrpcString;
-                               }
-                               /*if (strlen($_xh[$parser]['ac'])>0 &&
-                                       $_xh[$parser]['vt']==$xmlrpcString)
-                               {
-                                       $_xh[$parser]['st'].='"'. $_xh[$parser]['ac'] . '"';
-                               }
-                               // This if() detects if no scalar was inside <VALUE></VALUE>
-                               // and pads an empty ''.
-                               if($_xh[$parser]['st'][strlen($_xh[$parser]['st'])-1] == '(')
-                               {
-                                       $_xh[$parser]['st'].= '""';
-                               }
-                               // G. Giunta 2005/03/12 save some chars in the reconstruction of string vals...
-                               if ($_xh[$parser]['vt'] != $xmlrpcString)
-                                       $_xh[$parser]['st'].=", '" . $_xh[$parser]['vt'] . "')";
-                               else
-                                       $_xh[$parser]['st'].=")";
-                               if ($_xh[$parser]['cm'])
-                               {
-                                       $_xh[$parser]['st'].=',';
-                               }*/
-
-                               // build the xmlrpc val out of the data received, and substitute it
-                               $temp = new xmlrpcval($_xh[$parser]['value'], $_xh[$parser]['vt']);
-                               // check if we are inside an array or struct:
-                               // if value just built is inside an array, let's move it into array on the stack
-                               if ($_xh[$parser]['vsp'] && $_xh[$parser]['valuestack'][$_xh[$parser]['vsp']-1]['type']=='ARRAY')
-                               {
-                                       $_xh[$parser]['valuestack'][$_xh[$parser]['vsp']-1]['values'][] = $temp;
-                               }
-                               else
-                               {
-                               $_xh[$parser]['value'] = $temp;
-                               }
-                               break;
-                       case 'MEMBER':
-                               $_xh[$parser]['ac']='';
-                               //$_xh[$parser]['qt']=0;
-                               // add to array in the stack the last element built
-                               // unless no VALUE was found
-                               if ($_xh[$parser]['value'])
-                               {
-                                       $_xh[$parser]['valuestack'][$_xh[$parser]['vsp']-1]['values'][$_xh[$parser]['valuestack'][$_xh[$parser]['vsp']-1]['name']] = $_xh[$parser]['value'];
-                               }
-                               else
-                                       error_log('XML-RPC: missing VALUE inside STRUCT in received xml');
-                               break;
-                       case 'DATA':
-                               $_xh[$parser]['ac']='';
-                               //$_xh[$parser]['qt']=0;
-                               break;
-                       case 'PARAM':
-                               //$_xh[$parser]['params'][]=$_xh[$parser]['st'];
-                               if ($_xh[$parser]['value'])
-                                       $_xh[$parser]['params'][]=$_xh[$parser]['value'];
-                               else
-                                       error_log('XML-RPC: missing VALUE inside PARAM in received xml');
-                               break;
-                       case 'METHODNAME':
-                               $_xh[$parser]['method']=ereg_replace("^[\n\r\t ]+", '', $_xh[$parser]['ac']);
-                               break;
-                       case 'PARAMS':
-                       case 'FAULT':
-                       case 'METHODCALL':
-                       case 'METHORESPONSE':
-                               break;
-                       default:
-                               // End of INVALID ELEMENT!
-                               // shall we add an assert here for unreachable code???
-                               break;
+                                       // drop through intentionally if nil extension not enabled
+                               case 'PARAMS':
+                               case 'FAULT':
+                               case 'METHODCALL':
+                               case 'METHORESPONSE':
+                                       break;
+                               default:
+                                       // End of INVALID ELEMENT!
+                                       // shall we add an assert here for unreachable code???
+                                       break;
+                       }
                }
                }
-               // if it's a valid type name, set the type
-               /*if (isset($xmlrpcTypes[strtolower($name)]))
-               {
-                       $_xh[$parser]['vt']=strtolower($name);
-               }*/
+       }
 
 
-               }
+       /// Used in decoding xmlrpc requests/responses without rebuilding xmlrpc values
+       function xmlrpc_ee_fast($parser, $name)
+       {
+               xmlrpc_ee($parser, $name, false);
        }
 
        }
 
+       /// xml parser handler function for character data
        function xmlrpc_cd($parser, $data)
        {
        function xmlrpc_cd($parser, $data)
        {
-               global $_xh, $xmlrpc_backslash;
-
-               //if (ereg("^[\n\r \t]+$", $data)) return;
-               // print "adding [${data}]\n";
-
                // skip processing if xml fault already detected
                // skip processing if xml fault already detected
-               if ($_xh[$parser]['isf'] < 2)
-               {
-               if ($_xh[$parser]['lv']!=3)
+               if ($GLOBALS['_xh']['isf'] < 2)
                {
                        // "lookforvalue==3" means that we've found an entire value
                        // and should discard any further character data
                {
                        // "lookforvalue==3" means that we've found an entire value
                        // and should discard any further character data
-                       if ($_xh[$parser]['lv']==1)
-                       {
-                               // if we've found text and we're just in a <value> then
-                               // turn quoting on, as this will be a string
-                                       //$_xh[$parser]['qt']=1;
-                               // and say we've found a value
-                               $_xh[$parser]['lv']=2;
-                       }
-                       if(!@isset($_xh[$parser]['ac']))
+                       if($GLOBALS['_xh']['lv']!=3)
                        {
                        {
-                               $_xh[$parser]['ac'] = '';
-                       }
-                               //$_xh[$parser]['ac'].=str_replace('$', '\$', str_replace('"', '\"', str_replace(chr(92),$xmlrpc_backslash, $data)));
-                               $_xh[$parser]['ac'].=$data;
+                               // G. Giunta 2006-08-23: useless change of 'lv' from 1 to 2
+                               //if($GLOBALS['_xh']['lv']==1)
+                               //{
+                                       // if we've found text and we're just in a <value> then
+                                       // say we've found a value
+                                       //$GLOBALS['_xh']['lv']=2;
+                               //}
+                               // we always initialize the accumulator before starting parsing, anyway...
+                               //if(!@isset($GLOBALS['_xh']['ac']))
+                               //{
+                               //      $GLOBALS['_xh']['ac'] = '';
+                               //}
+                               $GLOBALS['_xh']['ac'].=$data;
                        }
                }
        }
 
                        }
                }
        }
 
+       /// xml parser handler function for 'other stuff', ie. not char data or
+       /// element start/end tag. In fact it only gets called on unknown entities...
        function xmlrpc_dh($parser, $data)
        {
        function xmlrpc_dh($parser, $data)
        {
-               global $_xh, $xmlrpc_backslash;
-
                // skip processing if xml fault already detected
                // skip processing if xml fault already detected
-               if ($_xh[$parser]['isf'] < 2)
-               {
-               if (substr($data, 0, 1) == '&' && substr($data, -1, 1) == ';')
+               if ($GLOBALS['_xh']['isf'] < 2)
                {
                {
-                       if ($_xh[$parser]['lv']==1)
+                       if(substr($data, 0, 1) == '&' && substr($data, -1, 1) == ';')
                        {
                        {
-                                       //$_xh[$parser]['qt']=1;
-                               $_xh[$parser]['lv']=2;
-                       }
-                               //$_xh[$parser]['ac'].=str_replace('$', '\$', str_replace('"', '\"', str_replace(chr(92),$xmlrpc_backslash, $data)));
-                               $_xh[$parser]['ac'].=$data;
+                               // G. Giunta 2006-08-25: useless change of 'lv' from 1 to 2
+                               //if($GLOBALS['_xh']['lv']==1)
+                               //{
+                               //      $GLOBALS['_xh']['lv']=2;
+                               //}
+                               $GLOBALS['_xh']['ac'].=$data;
                        }
                }
                        }
                }
+               return true;
        }
 
        class xmlrpc_client
        {
                var $path;
                var $server;
        }
 
        class xmlrpc_client
        {
                var $path;
                var $server;
-               var $port;
+               var $port=0;
+               var $method='http';
                var $errno;
                var $errstr;
                var $debug=0;
                var $username='';
                var $password='';
                var $errno;
                var $errstr;
                var $debug=0;
                var $username='';
                var $password='';
+               var $authtype=1;
                var $cert='';
                var $certpass='';
                var $cert='';
                var $certpass='';
-               var $verifypeer=1;
+               var $cacert='';
+               var $cacertdir='';
+               var $key='';
+               var $keypass='';
+               var $verifypeer=true;
                var $verifyhost=1;
                var $no_multicall=false;
                var $verifyhost=1;
                var $no_multicall=false;
-
-               function xmlrpc_client($path, $server, $port=0)
-               {
-                       $this->port=$port; $this->server=$server; $this->path=$path;
-               }
-
-               function setDebug($in)
-               {
-                       if ($in)
+               var $proxy='';
+               var $proxyport=0;
+               var $proxy_user='';
+               var $proxy_pass='';
+               var $proxy_authtype=1;
+               var $cookies=array();
+               /**
+               * List of http compression methods accepted by the client for responses.
+               * NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib
+               *
+               * NNB: you can set it to any non-empty array for HTTP11 and HTTPS, since
+               * in those cases it will be up to CURL to decide the compression methods
+               * it supports. You might check for the presence of 'zlib' in the output of
+               * curl_version() to determine wheter compression is supported or not
+               */
+               var $accepted_compression = array();
+               /**
+               * Name of compression scheme to be used for sending requests.
+               * Either null, gzip or deflate
+               */
+               var $request_compression = '';
+               /**
+               * CURL handle: used for keep-alive connections (PHP 4.3.8 up, see:
+               * http://curl.haxx.se/docs/faq.html#7.3)
+               */
+               var $xmlrpc_curl_handle = null;
+               /// Wheter to use persistent connections for http 1.1 and https
+               var $keepalive = false;
+               /// Charset encodings that can be decoded without problems by the client
+               var $accepted_charset_encodings = array();
+               /// Charset encoding to be used in serializing request. NULL = use ASCII
+               var $request_charset_encoding = '';
+               /**
+               * Decides the content of xmlrpcresp objects returned by calls to send()
+               * valid strings are 'xmlrpcvals', 'phpvals' or 'xml'
+               */
+               var $return_type = 'xmlrpcvals';
+
+               /**
+               * @param string $path either the complete server URL or the PATH part of the xmlrc server URL, e.g. /xmlrpc/server.php
+               * @param string $server the server name / ip address
+               * @param integer $port the port the server is listening on, defaults to 80 or 443 depending on protocol used
+               * @param string $method the http protocol variant: defaults to 'http', 'https' and 'http11' can be used if CURL is installed
+               */
+               function xmlrpc_client($path, $server='', $port='', $method='')
+               {
+                       // allow user to specify all params in $path
+                       if($server == '' and $port == '' and $method == '')
+                       {
+                               $parts = parse_url($path);
+                               $server = $parts['host'];
+                               $path = $parts['path'];
+                               if(isset($parts['query']))
+                               {
+                                       $path .= '?'.$parts['query'];
+                               }
+                               if(isset($parts['fragment']))
+                               {
+                                       $path .= '#'.$parts['fragment'];
+                               }
+                               if(isset($parts['port']))
+                               {
+                                       $port = $parts['port'];
+                               }
+                               if(isset($parts['scheme']))
+                               {
+                                       $method = $parts['scheme'];
+                               }
+                               if(isset($parts['user']))
+                               {
+                                       $this->username = $parts['user'];
+                               }
+                               if(isset($parts['pass']))
+                               {
+                                       $this->password = $parts['pass'];
+                               }
+                       }
+                       if($path == '' || $path[0] != '/')
                        {
                        {
-                               $this->debug=1;
+                               $this->path='/'.$path;
                        }
                        else
                        {
                        }
                        else
                        {
-                               $this->debug=0;
+                               $this->path=$path;
+                       }
+                       $this->server=$server;
+                       if($port != '')
+                       {
+                               $this->port=$port;
                        }
                        }
+                       if($method != '')
+                       {
+                               $this->method=$method;
+                       }
+
+                       // if ZLIB is enabled, let the client by default accept compressed responses
+                       if(function_exists('gzinflate') || (
+                               function_exists('curl_init') && (($info = curl_version()) &&
+                               ((is_string($info) && strpos($info, 'zlib') !== null) || isset($info['libz_version'])))
+                       ))
+                       {
+                               $this->accepted_compression = array('gzip', 'deflate');
+                       }
+
+                       // keepalives: enabled by default ONLY for PHP >= 4.3.8
+                       // (see http://curl.haxx.se/docs/faq.html#7.3)
+                       if(version_compare(phpversion(), '4.3.8') >= 0)
+                       {
+                               $this->keepalive = true;
+                       }
+
+                       // by default the xml parser can support these 3 charset encodings
+                       $this->accepted_charset_encodings = array('UTF-8', 'ISO-8859-1', 'US-ASCII');
                }
 
                }
 
-               function setCredentials($u, $p)
+               /**
+               * Enables/disables the echoing to screen of the xmlrpc responses received
+               * @param integer $debug values 0, 1 and 2 are supported (2 = echo sent msg too, before received response)
+               * @access public
+               */
+               function setDebug($in)
+               {
+                       $this->debug=$in;
+               }
+
+               /**
+               * Add some http BASIC AUTH credentials, used by the client to authenticate
+               * @param string $u username
+               * @param string $p password
+               * @param integer $t auth type. See curl_setopt man page for supported auth types. Defaults to CURLAUTH_BASIC (basic auth)
+               * @access public
+               */
+               function setCredentials($u, $p, $t=1)
                {
                        $this->username=$u;
                        $this->password=$p;
                {
                        $this->username=$u;
                        $this->password=$p;
+                       $this->authtype=$t;
                }
 
                }
 
+               /**
+               * Add a client-side https certificate
+               * @param string $cert
+               * @param string $certpass
+               * @access public
+               */
                function setCertificate($cert, $certpass)
                {
                        $this->cert = $cert;
                        $this->certpass = $certpass;
                }
 
                function setCertificate($cert, $certpass)
                {
                        $this->cert = $cert;
                        $this->certpass = $certpass;
                }
 
+               /**
+               * Add a CA certificate to verify server with (see man page about
+               * CURLOPT_CAINFO for more details
+               * @param string $cacert certificate file name (or dir holding certificates)
+               * @param bool $is_dir set to true to indicate cacert is a dir. defaults to false
+               * @access public
+               */
+               function setCaCertificate($cacert, $is_dir=false)
+               {
+                       if ($is_dir)
+                       {
+                               $this->cacert = $cacert;
+                       }
+                       else
+                       {
+                               $this->cacertdir = $cacert;
+                       }
+               }
+
+               /**
+               * Set attributes for SSL communication: private SSL key
+               * @param string $key The name of a file containing a private SSL key
+               * @param string $keypass The secret password needed to use the private SSL key
+               * @access public
+               * NB: does not work in older php/curl installs
+               * Thanks to Daniel Convissor
+               */
+               function setKey($key, $keypass)
+               {
+                       $this->key = $key;
+                       $this->keypass = $keypass;
+               }
+
+               /**
+               * Set attributes for SSL communication: verify server certificate
+               * @param bool $i enable/disable verification of peer certificate
+               * @access public
+               */
                function setSSLVerifyPeer($i)
                {
                        $this->verifypeer = $i;
                }
 
                function setSSLVerifyPeer($i)
                {
                        $this->verifypeer = $i;
                }
 
+               /**
+               * Set attributes for SSL communication: verify match of server cert w. hostname
+               * @param int $i
+               * @access public
+               */
                function setSSLVerifyHost($i)
                {
                        $this->verifyhost = $i;
                }
 
                function setSSLVerifyHost($i)
                {
                        $this->verifyhost = $i;
                }
 
-               function send($msg, $timeout=0, $method='http')
+               /**
+               * Set proxy info
+               * @param string $proxyhost
+               * @param string $proxyport Defaults to 8080 for HTTP and 443 for HTTPS
+               * @param string $proxyusername Leave blank if proxy has public access
+               * @param string $proxypassword Leave blank if proxy has public access
+               * @param int $proxyauthtype set to constant CURLAUTH_NTLM to use NTLM auth with proxy
+               * @access public
+               */
+               function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '', $proxyauthtype = 1)
+               {
+                       $this->proxy = $proxyhost;
+                       $this->proxyport = $proxyport;
+                       $this->proxy_user = $proxyusername;
+                       $this->proxy_pass = $proxypassword;
+                       $this->proxy_authtype = $proxyauthtype;
+               }
+
+               /**
+               * Enables/disables reception of compressed xmlrpc responses.
+               * Note that enabling reception of compressed responses merely adds some standard
+               * http headers to xmlrpc requests. It is up to the xmlrpc server to return
+               * compressed responses when receiving such requests.
+               * @param string $compmethod either 'gzip', 'deflate', 'any' or ''
+               * @access public
+               */
+               function setAcceptedCompression($compmethod)
+               {
+                       if ($compmethod == 'any')
+                               $this->accepted_compression = array('gzip', 'deflate');
+                       else
+                               $this->accepted_compression = array($compmethod);
+               }
+
+               /**
+               * Enables/disables http compression of xmlrpc request.
+               * Take care when sending compressed requests: servers might not support them
+               * (and automatic fallback to uncompressed requests is not yet implemented)
+               * @param string $compmethod either 'gzip', 'deflate' or ''
+               * @access public
+               */
+               function setRequestCompression($compmethod)
+               {
+                       $this->request_compression = $compmethod;
+               }
+
+               /**
+               * Adds a cookie to list of cookies that will be sent to server.
+               * NB: setting any param but name and value will turn the cookie into a 'version 1' cookie:
+               * do not do it unless you know what you are doing
+               * @param string $name
+               * @param string $value
+               * @param string $path
+               * @param string $domain
+               * @param int $port
+               * @access public
+               *
+               * @todo check correctness of urlencoding cookie value (copied from php way of doing it...)
+               */
+               function setCookie($name, $value='', $path='', $domain='', $port=null)
+               {
+                       $this->cookies[$name]['value'] = urlencode($value);
+                       if ($path || $domain || $port)
+                       {
+                               $this->cookies[$name]['path'] = $path;
+                               $this->cookies[$name]['domain'] = $domain;
+                               $this->cookies[$name]['port'] = $port;
+                               $this->cookies[$name]['version'] = 1;
+                       }
+                       else
+                       {
+                               $this->cookies[$name]['version'] = 0;
+                       }
+               }
+
+               /**
+               * Send an xmlrpc request
+               * @param mixed $msg The message object, or an array of messages for using multicall, or the complete xml representation of a request
+               * @param integer $timeout Connection timeout, in seconds, If unspecified, a platform specific timeout will apply
+               * @param string $method if left unspecified, the http protocol chosen during creation of the object will be used
+               * @return xmlrpcresp
+               * @access public
+               */
+               function& send($msg, $timeout=0, $method='')
                {
                {
-                       if (is_array($msg))
+                       // if user deos not specify http protocol, use native method of this client
+                       // (i.e. method set during call to constructor)
+                       if($method == '')
+                       {
+                               $method = $this->method;
+                       }
+
+                       if(is_array($msg))
                        {
                                // $msg is an array of xmlrpcmsg's
                        {
                                // $msg is an array of xmlrpcmsg's
-                               return $this->multicall($msg, $timeout, $method);
+                               $r = $this->multicall($msg, $timeout, $method);
+                               return $r;
+                       }
+                       elseif(is_string($msg))
+                       {
+                               $n =& new xmlrpcmsg('');
+                               $n->payload = $msg;
+                               $msg = $n;
                        }
 
                        // where msg is an xmlrpcmsg
                        $msg->debug=$this->debug;
 
                        }
 
                        // where msg is an xmlrpcmsg
                        $msg->debug=$this->debug;
 
-                       if ($method == 'https')
-                       {
-                               return $this->sendPayloadHTTPS($msg,
-                               $this->server,
-                               $this->port, $timeout,
-                               $this->username, $this->password,
-                               $this->cert,
-                               $this->certpass);
+                       if($method == 'https')
+                       {
+                               $r =& $this->sendPayloadHTTPS(
+                                       $msg,
+                                       $this->server,
+                                       $this->port,
+                                       $timeout,
+                                       $this->username,
+                                       $this->password,
+                                       $this->authtype,
+                                       $this->cert,
+                                       $this->certpass,
+                                       $this->cacert,
+                                       $this->cacertdir,
+                                       $this->proxy,
+                                       $this->proxyport,
+                                       $this->proxy_user,
+                                       $this->proxy_pass,
+                                       $this->proxy_authtype,
+                                       $this->keepalive,
+                                       $this->key,
+                                       $this->keypass
+                               );
+                       }
+                       elseif($method == 'http11')
+                       {
+                               $r =& $this->sendPayloadCURL(
+                                       $msg,
+                                       $this->server,
+                                       $this->port,
+                                       $timeout,
+                                       $this->username,
+                                       $this->password,
+                                       $this->authtype,
+                                       null,
+                                       null,
+                                       null,
+                                       null,
+                                       $this->proxy,
+                                       $this->proxyport,
+                                       $this->proxy_user,
+                                       $this->proxy_pass,
+                                       $this->proxy_authtype,
+                                       'http',
+                                       $this->keepalive
+                               );
                        }
                        else
                        {
                        }
                        else
                        {
-                               return $this->sendPayloadHTTP10($msg, $this->server, $this->port,
-                               $timeout, $this->username, 
-                               $this->password);
+                               $r =& $this->sendPayloadHTTP10(
+                                       $msg,
+                                       $this->server,
+                                       $this->port,
+                                       $timeout,
+                                       $this->username,
+                                       $this->password,
+                                       $this->authtype,
+                                       $this->proxy,
+                                       $this->proxyport,
+                                       $this->proxy_user,
+                                       $this->proxy_pass,
+                                       $this->proxy_authtype
+                               );
                        }
                        }
+
+                       return $r;
                }
 
                }
 
-               function sendPayloadHTTP10($msg, $server, $port, $timeout=0,$username='', $password='')
+               /**
+               * @access private
+               */
+               function &sendPayloadHTTP10($msg, $server, $port, $timeout=0,
+                       $username='', $password='', $authtype=1, $proxyhost='',
+                       $proxyport=0, $proxyusername='', $proxypassword='', $proxyauthtype=1)
                {
                {
-                       global $xmlrpcerr, $xmlrpcstr, $xmlrpcName, $xmlrpcVersion, $xmlrpc_defencoding;
-                       if ($port==0)
+                       if($port==0)
                        {
                                $port=80;
                        }
                        {
                                $port=80;
                        }
-                       if($timeout>0)
+
+                       // Only create the payload if it was not created previously
+                       if(empty($msg->payload))
                        {
                        {
-                               $fp=@fsockopen($server, $port,$this->errno, $this->errstr, $timeout);
+                               $msg->createPayload($this->request_charset_encoding);
+                       }
+
+                       $payload = $msg->payload;
+                       // Deflate request body and set appropriate request headers
+                       if(function_exists('gzdeflate') && ($this->request_compression == 'gzip' || $this->request_compression == 'deflate'))
+                       {
+                               if($this->request_compression == 'gzip')
+                               {
+                                       $a = @gzencode($payload);
+                                       if($a)
+                                       {
+                                               $payload = $a;
+                                               $encoding_hdr = "Content-Encoding: gzip\r\n";
+                                       }
+                               }
+                               else
+                               {
+                                       $a = @gzcompress($payload);
+                                       if($a)
+                                       {
+                                               $payload = $a;
+                                               $encoding_hdr = "Content-Encoding: deflate\r\n";
+                                       }
+                               }
                        }
                        else
                        {
                        }
                        else
                        {
-                               $fp=@fsockopen($server, $port,$this->errno, $this->errstr);
+                               $encoding_hdr = '';
                        }
                        }
-                       if ($fp)
+
+                       // thanks to Grant Rauscher <grant7@firstworld.net> for this
+                       $credentials='';
+                       if($username!='')
                        {
                        {
-                               if ($timeout>0 && function_exists('stream_set_timeout'))
-                                       stream_set_timeout($fp, $timeout);
+                               $credentials='Authorization: Basic ' . base64_encode($username . ':' . $password) . "\r\n";
+                               if ($authtype != 1)
+                               {
+                                       error_log('XML-RPC: xmlrpc_client::send: warning. Only Basic auth is supported with HTTP 1.0');
+                               }
+                       }
+
+                       $accepted_encoding = '';
+                       if(is_array($this->accepted_compression) && count($this->accepted_compression))
+                       {
+                               $accepted_encoding = 'Accept-Encoding: ' . implode(', ', $this->accepted_compression) . "\r\n";
+                       }
+
+                       $proxy_credentials = '';
+                       if($proxyhost)
+                       {
+                               if($proxyport == 0)
+                               {
+                                       $proxyport = 8080;
+                               }
+                               $connectserver = $proxyhost;
+                               $connectport = $proxyport;
+                               $uri = 'http://'.$server.':'.$port.$this->path;
+                               if($proxyusername != '')
+                               {
+                                       if ($proxyauthtype != 1)
+                                       {
+                                               error_log('XML-RPC: xmlrpc_client::send: warning. Only Basic auth to proxy is supported with HTTP 1.0');
+                                       }
+                                       $proxy_credentials = 'Proxy-Authorization: Basic ' . base64_encode($proxyusername.':'.$proxypassword) . "\r\n";
+                               }
                        }
                        else
                        {
                        }
                        else
                        {
-                               $this->errstr='Connect error';
-                               $r=new xmlrpcresp(0, $xmlrpcerr['http_error'],$xmlrpcstr['http_error']);
-                               return $r;
+                               $connectserver = $server;
+                               $connectport = $port;
+                               $uri = $this->path;
                        }
                        }
-                       // Only create the payload if it was not created previously
-                       if(empty($msg->payload))
+
+                       // Cookie generation, as per rfc2965 (version 1 cookies) or
+                       // netscape's rules (version 0 cookies)
+                       $cookieheader='';
+                       foreach ($this->cookies as $name => $cookie)
                        {
                        {
-                               $msg->createPayload();
+                               if ($cookie['version'])
+                               {
+                                       $cookieheader .= 'Cookie: $Version="' . $cookie['version'] . '"; ';
+                                       $cookieheader .= $name . '="' . $cookie['value'] . '";';
+                                       if ($cookie['path'])
+                                               $cookieheader .= ' $Path="' . $cookie['path'] . '";';
+                                       if ($cookie['domain'])
+                                               $cookieheader .= ' $Domain="' . $cookie['domain'] . '";';
+                                       if ($cookie['port'])
+                                               $cookieheader .= ' $Port="' . $cookie['domain'] . '";';
+                                       $cookieheader = substr($cookieheader, 0, -1) . "\r\n";
+                               }
+                               else
+                               {
+                                       $cookieheader .= 'Cookie: ' . $name . '=' . $cookie['value'] . "\r\n";
+                               }
                        }
 
                        }
 
-                       // thanks to Grant Rauscher <grant7@firstworld.net>
-                       // for this
-                       $credentials='';
-                       if ($username!='')
+                       $op= 'POST ' . $uri. " HTTP/1.0\r\n" .
+                               'User-Agent: ' . $GLOBALS['xmlrpcName'] . ' ' . $GLOBALS['xmlrpcVersion'] . "\r\n" .
+                               'Host: '. $server . ':' . $port . "\r\n" .
+                               $credentials .
+                               $proxy_credentials .
+                               $accepted_encoding .
+                               $encoding_hdr .
+                               'Accept-Charset: ' . implode(',', $this->accepted_charset_encodings) . "\r\n" .
+                               $cookieheader .
+                               'Content-Type: ' . $msg->content_type . "\r\nContent-Length: " .
+                               strlen($payload) . "\r\n\r\n" .
+                               $payload;
+
+                       if($this->debug > 1)
                        {
                        {
-                               $credentials='Authorization: Basic ' . base64_encode($username . ':' . $password) . "\r\n";
+                               print "<PRE>\n---SENDING---\n" . htmlentities($op) . "\n---END---\n</PRE>";
+                               // let the client see this now in case http times out...
+                               flush();
                        }
 
                        }
 
-                       $op= "POST " . $this->path. " HTTP/1.0\r\n" .
-                               "User-Agent: " . $xmlrpcName . " " . $xmlrpcVersion . "\r\n" .
-                               "Host: ". $server . "\r\n" .
-                               $credentials . 
-                               "Accept-Charset: " . $xmlrpc_defencoding . "\r\n" .
-                               "Content-Type: text/xml\r\nContent-Length: " .
-                               strlen($msg->payload) . "\r\n\r\n" .
-                               $msg->payload;
+                       if($timeout>0)
+                       {
+                               $fp=@fsockopen($connectserver, $connectport, $this->errno, $this->errstr, $timeout);
+                       }
+                       else
+                       {
+                               $fp=@fsockopen($connectserver, $connectport, $this->errno, $this->errstr);
+                       }
+                       if($fp)
+                       {
+                               if($timeout>0 && function_exists('stream_set_timeout'))
+                               {
+                                       stream_set_timeout($fp, $timeout);
+                               }
+                       }
+                       else
+                       {
+                               $this->errstr='Connect error: '.$this->errstr;
+                               $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr . ' (' . $this->errno . ')');
+                               return $r;
+                       }
 
 
-                       if (!fputs($fp, $op, strlen($op)))
+                       if(!fputs($fp, $op, strlen($op)))
                        {
                                $this->errstr='Write error';
                        {
                                $this->errstr='Write error';
-                               $r=new xmlrpcresp(0, $xmlrpcerr['http_error'], $xmlrpcstr['http_error']);
+                               $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['http_error'], $this->errstr);
                                return $r;
                        }
                                return $r;
                        }
-                       $resp=$msg->parseResponseFile($fp);
+                       else
+                       {
+                               // reset errno and errstr on succesful socket connection
+                               $this->errstr = '';
+                       }
+                       // G. Giunta 2005/10/24: close socket before parsing.
+                       // should yeld slightly better execution times, and make easier recursive calls (e.g. to follow http redirects)
+                       $ipd='';
+                       while($data=fread($fp, 32768))
+                       {
+                               // shall we check for $data === FALSE?
+                               // as per the manual, it signals an error
+                               $ipd.=$data;
+                       }
                        fclose($fp);
                        fclose($fp);
-                       return $resp;
+                       $r =& $msg->parseResponse($ipd, false, $this->return_type);
+                       return $r;
+
                }
 
                }
 
-               // contributed by Justin Miller <justin@voxel.net>
-               // requires curl to be built into PHP
-               function sendPayloadHTTPS($msg, $server, $port, $timeout=0,$username='', $password='', $cert='',$certpass='')
-               {
-                       global $xmlrpcerr, $xmlrpcstr, $xmlrpcVersion, $xmlrpc_internalencoding;
-                       if ($port == 0)
+               /**
+               * @access private
+               */
+               function &sendPayloadHTTPS($msg, $server, $port, $timeout=0, $username='',
+                       $password='', $authtype=1, $cert='',$certpass='', $cacert='', $cacertdir='',
+                       $proxyhost='', $proxyport=0, $proxyusername='', $proxypassword='', $proxyauthtype=1,
+                       $keepalive=false, $key='', $keypass='')
+               {
+                       $r =& $this->sendPayloadCURL($msg, $server, $port, $timeout, $username,
+                               $password, $authtype, $cert, $certpass, $cacert, $cacertdir, $proxyhost, $proxyport,
+                               $proxyusername, $proxypassword, $proxyauthtype, 'https', $keepalive, $key, $keypass);
+                       return $r;
+               }
+
+               /**
+               * Contributed by Justin Miller <justin@voxel.net>
+               * Requires curl to be built into PHP
+               * NB: CURL versions before 7.11.10 cannot use proxy to talk to https servers!
+               * @access private
+               */
+               function &sendPayloadCURL($msg, $server, $port, $timeout=0, $username='',
+                       $password='', $authtype=1, $cert='', $certpass='', $cacert='', $cacertdir='',
+                       $proxyhost='', $proxyport=0, $proxyusername='', $proxypassword='', $proxyauthtype=1, $method='https',
+                       $keepalive=false, $key='', $keypass='')
+               {
+                       if(!function_exists('curl_init'))
+                       {
+                               $this->errstr='CURL unavailable on this install';
+                               $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_curl'], $GLOBALS['xmlrpcstr']['no_curl']);
+                               return $r;
+                       }
+                       if($method == 'https')
                        {
                        {
-                               $port = 443;
+                               if(($info = curl_version()) &&
+                                       ((is_string($info) && strpos($info, 'OpenSSL') === null) || (is_array($info) && !isset($info['ssl_version']))))
+                               {
+                                       $this->errstr='SSL unavailable on this install';
+                                       $r=&new xmlrpcresp(0, $GLOBALS['xmlrpcerr']['no_ssl'], $GLOBALS['xmlrpcstr']['no_ssl']);
+                                       return $r;
+                               }
+                       }
+
+                       if($port == 0)
+                       {
+                               if($method == 'http')
+                               {
+     &n