[geeklog-jp commit] r500 - in trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy: . images

Back to archive index

codes****@googl***** codes****@googl*****
2008年 9月 11日 (木) 23:40:18 JST


Author: mystralkk
Date: Thu Sep 11 07:28:52 2008
New Revision: 500

Added:
    trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/
     
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/dataproxy_api_ja.html    
(contents, props changed)
    trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/images/
     
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/images/dataproxy.gif    
(contents, props changed)
     
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/index.php    
(contents, props changed)
     
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install.html    
(contents, props changed)
     
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install.php    
(contents, props changed)
     
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install_ja.html    
(contents, props changed)

Log:
dataproxyプラグインをtrunk/geeklog-1-jpからインポート。

Added:  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/dataproxy_api_ja.html
==============================================================================
--- (empty file)
+++  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/dataproxy_api_ja.html	 
Thu Sep 11 07:28:52 2008
@@ -0,0 +1,264 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="ja">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+	<meta http-equiv="Content-Style-Type" content="text/css">
+	<title>Geeklog DataproxyプラグインのAPI</title>
+	<style type="text/css">
+	<!-->
+		body {
+			color: black;
+			background-color: white;
+			line-height: 1.5em;
+			width: 780px;
+			margin: 10px auto 10px;
+		}
+		.caution {
+			padding: 10px;
+			font-weight: bold;
+			border: solid 1px black;
+			color: black;
+			background-color: yellow;
+		}
+		.code {
+			padding: 10px;
+			border: solid 1px black;
+			background-color: #ccffff;
+		}
+		table {
+			border: solid 1px black;
+			border-collapse: collapse;
+			padding: 3px;
+		}
+		th {
+			border: solid 1px black;
+			text-align: center;
+		}
+		td {
+			border: solid 1px black;
+			padding: 3px;
+		}
+	<! -->
+	</style>
+</head>
+
+<body>
+	<h1>Geeklog Dataproxyプラグインの<acronym title="Application Program  
Interface">API</acronym></h1>
+	<table>
+		<tr>
+			<th>制作者</th>
+			<td>mystral-kk - geeklog AT mystral-kk DOT net</td>
+		</tr>
+		<tr>
+			<th>バージョン</th>
+			<td>1.0.3</td>
+		</tr>
+		<tr>
+			<th>公開日</th>
+			<td>2007-12-26</td>
+		</tr>
+	</table>
+	
+	<h2>1. 概要</h2>
+	<p>Dataproxyプラグインは,Geeklogのコンテンツ取得代行・キャッシュ管理を行 
うプラグインです(<strong>バージョン1.0では,キャッシュ管理機能は実装されて 
いません</strong>)。通常,各プラグインが管理するデータを取得するには,それ 
ぞれSQLを組み立て,権限チェックを追加するなどの手順を踏む必要があります 
が,Dataproxyプラグインを使用すれば,簡単な手順と統一されたインターフェース 
でコンテンツを取り出すことができます。</p>
+	
+	<p class="caution">ご注意:Dataproxyプラグインはまだ開発初期の段階のた 
め,下記のAPIは変更される可能性があります。</p>
+	
+	<h2><a name="datasource"></a>2. データソース・カテゴリ・アイテム</h2>
+	<p>Dataproxyプラグインでは,コンテンツを提供する機能・プラグインを 
<strong>データソース</strong>として位置づけています。現時点でサポートされて 
いるデータソースは次の通りです。article, comments, trackbackは常に利用できま 
す。</p>
+	<ul>
+		<li>article(記事)</li>
+		<li>comments(コメント)</li>
+		<li>trackback(トラックバック)</li>
+		<li>staticpages(静的ページプラグイン)</li>
+		<li>calendar(カレンダプラグイン)</li>
+		<li>links(リンクプラグイン)</li>
+		<li>polls(アンケートプラグイン)</li>
+		<li>dokuwiki(DokuWikiプラグイン)</li>
+		<li>forum(掲示板プラグイン)</li>
+		<li>filemgmt(ファイル管理プラグイン)</li>
+		<li>faqman(FAQプラグイン)</li>
+		<li>mediagallery(メディアギャラリプラグイン)</li>
+	</ul>
+	
+	<p>また,各データソースは階層的な<strong>カテゴリ</strong>を持っています 
(staticpagesなどにはありません)。各階層にある具体的なコンテンツを 
<strong>アイテム</strong>と呼びます。</p>
+	
+	<h2>3. Dataproxyプラグインの利用法</h2>
+	<p>Dataproxyプラグインがインストールされ,有効になっていれば,次の1行を記 
述するだけでDataproxyプラグインが提供するAPIを利用できます。</p>
+	<div class="code">$dataproxy =&amp; new Dataproxy($uid);</div>
+	<p>PHP5の場合は,次のコードを推奨します。</p>
+	<div class="code">$dataproxy = new Dataproxy($uid);</div>
+	<p>$uidはデータを取得するユーザのID($_USER['uid'])です。デフォルト値は 
1(ゲストユーザの扱い)です。全データを取得する必要がある場合は,0を指定しま 
す。</p>
+	
+	<h2>4. Dataproxyクラス</h2>
+	
+	<p>Dataproxyクラスは実際にデータを取得するDataproxyDriverクラスの生成・管 
理を担当します。現在有効になっているプラグインを認識し,必要な 
DataproxyDriverクラスのインスタンスを作成します。</p>
+	
+	<h3>4.1 Dataproxyクラス - 公開メソッド</h3>
+	<div class="code">setUid($uid)</div>
+	<p>Dataproxyプラグインを使用するユーザIDをセットします。ユーザIDは 
Dataproxyクラスのインスタンスを作成するときに指定するので,ふつう,このメソ 
ッドを呼び出す必要はありません。</p>
+	
+	<div class="code">getUid()</div>
+	<p>Dataproxyプラグインを使用しているユーザのIDを返します。</p>
+	
+	<div class="code">setEncoding($encoding)</div>
+	<p>Dataproxyプラグインの内部エンコーディングを指定します。内部エンコーディ 
ングはDataproxyクラスのインスタンスを作成するときに指定するので,ふつう,こ 
のメソッドを呼び出す必要はありません。</p>
+	
+	<div class="code">getEncoding()</div>
+	<p>Dataproxyプラグインの内部エンコーディングを返します。</p>
+	
+	<div class="code">setOptions($options)</div>
+	<p>Dataproxyプラグインに与えるオプションを連想配列の形式で指定します。オプ 
ションはDataproxyクラスのインスタンスを作成するときに指定するので,ふつ 
う,このメソッドを呼び出す必要はありません。</p>
+	
+	<div class="code">getOptions()</div>
+	<p>Dataproxyプラグインに与えられているオプションを連想配列の形式で返しま 
す。</p>
+	
+	<div class="code">getAllSupportedDriverNames()</div>
+	<p>Dataproxyプラグインでサポートされている<a href="#datasource">データソー 
ス</a>名の配列を返します。</p>
+	
+	<div class="code">getAllDriverNames()</div>
+	<p>Dataproxyプラグインで現在有効になっているデータソース名の配列を返しま 
す。サポートされている<a href="#datasource">データソース</a>については,上記 
をご覧ください。</p>
+	
+	<div class="code">escape($str)</div>
+	<p>文字列をHTMLとして出力できるようエスケープします。</p>
+	
+	<h3>4.2 Dataproxyクラス - 公開メンバー</h3>
+	<p>以下のメンバーは,データソースオブジェクト(:DataproxyDriverクラス)へ 
のリファレンスになっています。
+	<ul>
+		<li>article</li>
+		<li>comments</li>
+		<li>trackback</li>
+		<li>staticpages</li>
+		<li>calendar</li>
+		<li>links</li>
+		<li>polls</li>
+		<li>dokuwiki</li>
+		<li>forum</li>
+		<li>filemgmt</li>
+		<li>faqman</li>
+		<li>mediagallery</li>
+	</ul>
+	
+	<h2>5. DataproxyDriverクラス</h2>
+	
+	<p>DataproxyDriverクラスは各コンテンツのデータ・メタデータを実際に取り出す 
データソースドライバの親クラスです。Dataproxyクラスが管理しますので,ユーザ 
がデータソースドライバをインスタンス化する必要はありません。</p>
+	
+	<h3>5.1 DataproxyDriverクラス - 公開メソッド</h3>
+	<div class="code">getDriverName()</div>
+	<p>データソースドライバ名を返します。</p>
+	
+	<div class="code">getAllSupportedDriverNames()</div>
+	<p>Dataproxyプラグインでサポートされている<a href="#datasource">データソー 
ス</a>名の配列を返します。サポートされているデータソースに関しては上記をご覧 
ください。</p>
+	
+	<div class="code">getAllDriverNames()</div>
+	<p>Dataproxyプラグインで現在有効になっているデータソース名の配列を返しま 
す。</p>
+	
+	<div class="code">getEntryPoint()</div>
+	<p>各プラグインのユーザに見えるトップページのURIを返します。staticpagesプ 
ラグインなどのようにトップページがない場合は,falseを返します。</p>
+	
+	<div class="code">getChildCategories($pid = false, $all_langs =  
false)</div>
+	<p>親カテゴリ$pidの下にあるすべての子カテゴリのメタデータを配列で返しま 
す。配列の要素は以下のようになっています。ルートカテゴリの場合は,$pidに 
falseを指定して呼び出します。多言語機能を有効にしたサイトで$all_langsに 
trueを指定すると,カレントユーザの言語IDを無視します。Googleサイトマップなど 
を作成する場合に有効です。</p>
+	<ul>
+		<li>id - カテゴリID(string)</li>
+		<li>pid - 親カテゴリのID(string)</li>
+		<li>title - カテゴリのタイトル(string)</li>
+		<li>uri - カテゴリのURI(string)</li>
+		<li>date - カテゴリの作成(更新)日(int: Unix timestamp, ない場合は 
false)</li>
+		<li>image_uri - カテゴリの画像のURI(string, ない場合はfalse)</li>
+	</ul>
+	
+	<div class="code">getAllCategories($all_langs = false)</div>
+	<p>データソースが持つすべてのカテゴリのメタデータを配列で返します。配列の 
要素は,getChildCategories()と同じです。多言語機能を有効にしたサイトで 
$all_langsにtrueを指定すると,カレントユーザの言語IDを無視します。Googleサイ 
トマップなどを作成する場合に有効です。</p>
+	
+	<div class="code">getItems($category, $all_langs = false)</div>
+	<p>親カテゴリ$pidの下にあるすべてのアイテムのメタデータを配列で返します。 
配列の要素は以下のようになっています。ルートカテゴリの場合は,$pidにfalseを 
指定して呼び出します。多言語機能を有効にしたサイトで$all_langsにtrueを指定す 
ると,カレントユーザの言語IDを無視します。Googleサイトマップなどを作成する場 
合に有効です。</p>
+	<ul>
+		<li>id - アイテムID(string)</li>
+		<li>pid - 親カテゴリのID(string)</li>
+		<li>title - アイテムのタイトル(string)</li>
+		<li>uri - アイテムのURI(string)</li>
+		<li>date - アイテムの作成(更新)日(int: Unix timestamp, ない場合は 
false)</li>
+		<li>image_uri - アイテムの画像のURI(string, ない場合はfalse)</li>
+	</ul>
+	
+	<div class="code">getItemById($id, $all_langs = false)</div>
+	<p>$idで指定されたIDを持つアイテム1個分のメタデータと生データを配列で返し 
ます。配列の要素は以下のようになっています。</p>
+	<ul>
+		<li>id - アイテムID(string)</li>
+		<li>pid - 親カテゴリのID(string)</li>
+		<li>title - アイテムのタイトル(string)</li>
+		<li>uri - アイテムのURI(string)</li>
+		<li>date - アイテムの作成(更新)日(int: Unix timestamp, ない場合は 
false)</li>
+		<li>image_uri - カテゴリの画像のURI(string, ない場合はfalse)</li>
+		<li>raw_data - データベースから取り出した生のデータ(ただ 
し,stripslashes()は適用済み)</li>
+	</ul>
+	
+	<div class="code">getAllItems($all_langs = false)</div>
+	<p>データソースが持つすべてのアイテムのメタデータを配列で返します。配列の 
要素は,getItems()と同じです。多言語機能を有効にしたサイトで$all_langsに 
trueを指定すると,カレントユーザの言語IDを無視します。Googleサイトマップなど 
を作成する場合に有効です。</p>
+	
+	<div class="code">escape($str)</div>
+	<p>文字列をHTMLとして出力できるようエスケープします。</p>
+	
+	<div class="code">toUtf8($str)</div>
+	<p>$strをUTF-8に変換します。</p>
+	
+	<div class="code">cleanUrl($url)</div>
+	<p>与えられたURIから<acronym title="Cross Site Scripting">XSS</acronym>の 
可能性のあるコードを取り除きます。</p>
+	
+	<h2>6. Dataproxyプラグイン利用のコーディング例</h2>
+	<p>例1. 記事のメタデータを全て(カレントユーザの言語のみ)取り出す</p>
+	<div class="code">
+		$dataproxy =&amp; new Dataproxy;<br>
+		$item_metadata = $dataproxy-&gt;article-&gt;getAllItems();
+	</div>
+	
+	<p>例1. 記事のメタデータを全て(すべての言語)取り出す。</p>
+	<div class="code">
+		$dataproxy =&amp; new Dataproxy;<br>
+		$item_metadata = $dataproxy-&gt;article-&gt;getAllItems(true);
+	</div>
+	
+	<p>例2. 静的ページのメタデータを全て取り出す</p>
+	<div class="code">
+		$dataproxy =&amp; new Dataproxy;<br>
+		$item_metadata = $dataproxy-&gt;staticpages-&gt;getAllItems();
+	</div>
+	
+	<p>例3. 'foo'カテゴリの記事のメタデータを全て取り出す</p>
+	<div class="code">
+		$dataproxy =&amp; new Dataproxy;<br>
+		$item_metadata = $dataproxy-&gt;article-&gt;getItems('foo');
+	</div>
+	
+	<p>例4. 記事IDが'bar'の記事のデータを取り出す</p>
+	<div class="code">
+		$dataproxy =&amp; new Dataproxy;<br>
+		$item = $dataproxy-&gt;article-&gt;getItem('bar');
+	</div>
+	
+	<p>例5. 全データソースのアイテムのメタデータを全て取り出す</p>
+	<div class="code">
+		$items = array ();<br>
+		$dataproxy =&amp; new Dataproxy;<br>
+		$drivers = $dataproxy-&gt;getAllDriverNames();<br>
+		<br>
+		foreach ($drivers as $driver) {<br>
+		&nbsp;&nbsp;	$items[] = $dataproxy-&gt;$driver-&gt;getAllItems();<br>
+		}
+	</div>
+
+	<h2>7. APIの変更履歴</h2>
+	<table>
+		<tr>
+			<th width="100">バージョン</th><th>公開日</th><th>変更点</th>
+		</tr>
+		<tr>
+			<td style="text-align: center;">1.0.0</td><td>2007-11-04</td><td>初期 
バージョン</td>
+		</tr>
+		<tr>
+			<td style="text-align:  
center;">1.0.3</td><td>2007-12-26</td><td>getChildCategories(),  
getAllCategories(), getAllCategoriesAsLinks(), getItemById(), getItems(),  
getItemsAsLinks), getAllItems()で,$all_langsパラメータ(オプション)を追加 
した。</td>
+		</tr>
+	</table>
+
+</body>
+</html>

Added:  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/images/dataproxy.gif
==============================================================================
Binary file. No diff available.

Added:  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/index.php
==============================================================================
--- (empty file)
+++  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/index.php	 
Thu Sep 11 07:28:52 2008
@@ -0,0 +1,75 @@
+<?php
+
+//  
+---------------------------------------------------------------------------+
+// | Data Proxy Plugin for Geeklog - The Ultimate  
Weblog                       |
+//  
+---------------------------------------------------------------------------+
+// |  
public_html/admin/plugins/dataproxy/index.php                             |
+//  
+---------------------------------------------------------------------------+
+// | Copyright (C) 2007-2008 mystral-kk - geeklog AT mystral-kk DOT  
net        |
+//  
|                                                                            
|
+// | Constructed with the Universal  
Plugin                                     |
+// | Copyright (C) 2002 by the following  
authors:                              |
+// | Tom Willett                 -     
twill****@users*****           |
+// | Blaine Lang                 -     
langm****@sympa*****                    |
+// | The Universal Plugin is based on prior work  
by:                           |
+// | Tony Bibbs                  -     
tony****@tonyb*****                       |
+//  
+---------------------------------------------------------------------------+
+//  
|                                                                            
|
+// | This program is free software; you can redistribute it  
and/or             |
+// | modify it under the terms of the GNU General Public  
License               |
+// | as published by the Free Software Foundation; either version  
2            |
+// | of the License, or (at your option) any later  
version.                    |
+//  
|                                                                            
|
+// | This program is distributed in the hope that it will be  
useful,           |
+// | but WITHOUT ANY WARRANTY; without even the implied warranty  
of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See  
the             |
+// | GNU General Public License for more  
details.                              |
+//  
|                                                                            
|
+// | You should have received a copy of the GNU General Public  
License         |
+// | along with this program; if not, write to the Free Software  
Foundation,   |
+// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,  
USA.           |
+//  
|                                                                            
|
+//  
+---------------------------------------------------------------------------+
+
+require_once '../../../lib-common.php';
+
+/**
+* Only let admin users access this page
+*/
+if (!SEC_hasRights('dataproxy.admin')) {
+    // Someone is trying to illegally access this page
+    COM_errorLog( "Someone has tried to illegally access the dataproxy  
Admin page.  User id: {$_USER['uid']}, Username: {$_USER['username']}, IP:  
{$_SERVER['REMOTE_ADDR']}", 1 );
+    $display = COM_siteHeader()
+			 . COM_startBlock(DPXY_str('access_denied'))
+			 . DPXY_str('access_denied_msg')
+			 . COM_endBlock()
+			 . COM_siteFooter();
+    echo $display;
+    exit;
+}
+
+/**
+* Main
+*/
+if (!defined('XHTML')) {
+	define('XHTML', '');
+}
+
+$display = COM_siteHeader();
+$T = new Template($_CONF['path'] . 'plugins/dataproxy/templates');
+$T->set_file('admin', 'admin.thtml');
+$T->set_var('xhtml', XHTML);
+$T->set_var('site_url', $_CONF['site_url']);
+$T->set_var('site_admin_url', $_CONF['site_admin_url']);
+ $T->set_var('icon_url',  
$_CONF['site_admin_url'] . '/plugins/dataproxy/images/dataproxy.gif');
+$T->set_var('header', DPXY_str('admin'));
+$T->set_var('plugin', 'dataproxy');
+
+// put your code here
+
+
+$T->parse('output', 'admin');
+$display .= $T->finish($T->get_var('output'))
+		 .  COM_siteFooter();
+
+echo $display;

Added:  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install.html
==============================================================================
--- (empty file)
+++  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install.html	 
Thu Sep 11 07:28:52 2008
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="en">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+	<meta http-equiv="Content-Style-Type" content="text/css">
+	<title>Install/Uninstall instruction for the Geeklog dataproxy  
plugin</title>
+	<style type="text/css">
+	<!-->
+		body {
+			color: black;
+			background-color: white;
+			line-height: 1.5em;
+		}
+		.geeklog {
+			background-color: yellow;
+		}
+		.public {
+			background-color: #99ff00;
+		}
+		.admin {
+			background-color: aqua;
+		}
+		.fix {
+			color: white;
+			background-color: red;
+			font-weight: bold;
+		}
+		.new {
+			color: white;
+			background-color: green;
+			font-weight: bold;
+		}
+	<! -->
+	</style>
+</head>
+
+<body>
+	<h1>Install/Uninstall instruction for the Geeklog dataproxy plugin</h1>
+
+	<p>In the following descriptions</p>
+	<ul>
+		<li><span class="geeklog">&lt;geeklog_dir&gt;</span> is the directory  
where the system config.php file resides</li>
+		<li><span class="public">&lt;public_html&gt;</span> is the directory  
where the lib-common.php file resides</li>
+		<li><span class="admin">&lt;admin&gt;</span> is the directory where the  
administration files reside (usually, under <span  
class="public">&lt;public_html&gt;</span>)</li>
+	</ul>
+
+	<h2>INSTALL:</h2>
+
+	<ol>
+		<li>Back up your Geeklog Database.  The dataproxy plugin adds tables to  
your Geeklog database.  You can do this with the built in admin backup  
facility.</li>
+		<li>Uncompress the dataproxy plugin archive while in the <span  
class="geeklog">&lt;geeklog_dir&gt;</span>/plugins directory.  The archive  
will create a directory called dataproxy in the plugins directory.</li>
+		<li>Create the admin directory.  Under your <span  
class="admin">&lt;admin&gt;</span>/plugins/ directory create a directory  
called dataproxy.</li>
+		<li>Change to your <span  
class="geeklog">&lt;geeklog_dir&gt;</span>/plugins/dataproxy/ directory.   
Copy the files in the admin directory to the <span  
class="admin">&lt;admin&gt;</span>/plugins/dataproxy/ directory your  
created in step 3.  </li>
+		<li>Log in to your Geeklog as a root user and run install.php in your  
<span class="admin">&lt;admin&gt;</span>/plugins/dataproxy/ directory.  The  
install page will tell you if the install was successful or not.  If not,  
examine Geeklog system errorlog for possible problems.  The dataproxy  
plugin should now be installed and functioning.  Clicking on the dataproxy  
Icon will take you to the admin page.</li>
+		<li>Set up security.  On install only the root users have access to  
dataproxy administration and Viewing.  You can delegate control for either  
of these functions through the user and group editors.</li>
+	</ol>
+
+	<h2>UNINSTALL:</h2>
+
+	<ol>
+		<li>Run the install.php page in your <span  
class="admin">&lt;admin&gt;</span>/plugins/dataproxy directory.  This will  
remove all the data from your database.</li>
+		<li>Delete the two plugin directories created in the install process:   
<span class="geeklog">&lt;geeklog-dir&gt;</span>/plugins/dataproxy/ and  
<span class="admin">&lt;admin&gt;</span>/plugins/dataproxy/</li>
+	</ol>
+
+	<h2>HISTORY</h2>
+	<table border="1">
+		<tr>
+			<th>Version</th>
+			<th>Date</th>
+			<th>Description</th>
+		</tr>
+		<tr>
+			<td align="right">1.1.1</td>
+			<td>2008-09-11</td>
+			<td>
+				<span class="fix">Fixed</span> Upgraded to work well with Polls-2.0.1  
plugin shipped with Geeklog-1.5.0.
+			</td>
+		</tr>
+		<tr>
+			<td align="right">1.1.0</td>
+			<td>2008-08-15</td>
+			<td>
+				<span class="New">New</span> Upgraded to work well with Geeklog-1.5.0.
+			</td>
+		</tr>
+		<tr>
+			<td align="right">1.0.4</td>
+			<td>2008-05-22</td>
+			<td>
+				<span class="fix">Fixed</span> the wrong GET parameter in static pages  
when URL rewrite is off.<br>
+				<span class="fix">Fixed</span> to refer to $_SP_CONF['sort_by'] in  
deciding the order of static pages.
+			</td>
+		</tr>
+		<tr>
+			<td align="right">1.0.3</td>
+			<td>2007-12-26</td>
+			<td><span class="fix">Fixed</span> to better support multilingual  
stories.</td>
+		</tr>
+		<tr>
+			<td align="right">1.0.2</td>
+			<td>2007-12-25</td>
+			<td><span class="fix">Fixed</span> not to deal with formmail  
(staticpages).</td>
+		</tr>
+		<tr>
+			<td align="right">1.0.1</td>
+			<td>2007-11-10</td>
+			<td><span class="fix">Fixed</span> a missing bracket in  
drivers/mediagallery.class.php.<br></td>
+		</tr>
+		<tr>
+			<td align="right">1.0</td>
+			<td>2007-11-04</td>
+			<td>Initial version</td>
+		</tr>
+	</table>
+</body>
+</html>

Added:  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install.php
==============================================================================
--- (empty file)
+++  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install.php	 
Thu Sep 11 07:28:52 2008
@@ -0,0 +1,221 @@
+<?php
+
+//  
+---------------------------------------------------------------------------+
+// | Data Proxy Plugin for Geeklog - The Ultimate  
Weblog                       |
+//  
+---------------------------------------------------------------------------+
+// |  
public_html/admin/plugins/dataproxy/install.php                           |
+//  
+---------------------------------------------------------------------------+
+// | Copyright (C) 2007-2008 mystral-kk - geeklog AT mystral-kk DOT  
net        |
+//  
|                                                                            
|
+// | Constructed with the Universal  
Plugin                                     |
+// | Copyright (C) 2002 by the following  
authors:                              |
+// | Tom Willett                 -     
twill****@users*****           |
+// | Blaine Lang                 -     
langm****@sympa*****                    |
+// | The Universal Plugin is based on prior work  
by:                           |
+// | Tony Bibbs                  -     
tony****@tonyb*****                       |
+//  
+---------------------------------------------------------------------------+
+//  
|                                                                            
|
+// | This program is free software; you can redistribute it  
and/or             |
+// | modify it under the terms of the GNU General Public  
License               |
+// | as published by the Free Software Foundation; either version  
2            |
+// | of the License, or (at your option) any later  
version.                    |
+//  
|                                                                            
|
+// | This program is distributed in the hope that it will be  
useful,           |
+// | but WITHOUT ANY WARRANTY; without even the implied warranty  
of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See  
the             |
+// | GNU General Public License for more  
details.                              |
+//  
|                                                                            
|
+// | You should have received a copy of the GNU General Public  
License         |
+// | along with this program; if not, write to the Free Software  
Foundation,   |
+// | Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,  
USA.           |
+//  
|                                                                            
|
+//  
+---------------------------------------------------------------------------+
+
+require_once '../../../lib-common.php';
+require_once $_CONF['path'] . 'plugins/dataproxy/config.php';
+require_once $_CONF['path'] . 'plugins/dataproxy/functions.inc';
+
+$pi_name    = 'dataproxy';               	// Plugin name  Must be 15 chars  
or less
+$pi_version = $_DPXY_CONF['pi_version'];	// Plugin Version
+$gl_version = $_DPXY_CONF['gl_version'];	// GL Version plugin for
+$pi_url     = $_DPXY_CONF['pi_url'];		// Plugin Homepage
+
+// $NEWTABLE contains table name(s) and sql to create it(them)
+// Fill it in and you are ready to go.
+// Note: you must put the table names in the uninstall routine in  
functions.inc
+// and in the $_TABLES array in config.php.
+// Note: Be sure to replace table1, table2 with the actual names of your  
tables.
+// and the table definition with the definition of your table
+
+$NEWTABLE = array ();
+$NEWTABLE['dpxy_notify'] = "CREATE TABLE {$_TABLES['dpxy_notify']} ("
+						 . "id int(10) NOT NULL AUTO_INCREMENT,"
+						 . "callback_name VARCHAR(30) NOT NULL DEFAULT '',"
+						 . "type VARCHAR(255) NOT NULL DEFAULT '',"
+						 . "KEY id(id)"
+						 . ")";
+
+/**
+* Default data
+*/
+$DEFVALUES = array ();
+
+/**
+* Security Feature(s) to add
+*/
+$NEWFEATURE = array ();
+$NEWFEATURE['dataproxy.admin'] = 'dataproxy Admin';
+
+/**
+* Only let Root users access this page
+*/
+if (!SEC_inGroup('Root')) {
+	// Someone is trying to illegally access this page
+	COM_errorLog("Someone has tried to illegally access the dataproxy  
install/uninstall page.  User id: {$_USER['uid']}, Username:  
{$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1);
+	$display = COM_siteHeader()
+			 . COM_startBlock(DPXY_str('access_denied'))
+			 . DPXY_str('access_denied_msg')
+			 . COM_endBlock()
+			 . COM_siteFooter();
+	echo $display;
+	exit;
+}
+
+/**
+* Puts the datastructures for this plugin into the Geeklog database
+*
+* Note: Corresponding uninstall routine is in functions.inc
+*
+* @return   boolean True if successful False otherwise
+*/
+function plugin_install_dataproxy() {
+	global $pi_name, $pi_version, $gl_version, $pi_url, $NEWTABLE, $DEFVALUES,
+		   $NEWFEATURE, $_TABLES, $_CONF;
+	
+	COM_errorLog("Attempting to install the {$pi_name} Plugin", 1);
+	
+	// Create the Plugins Tables
+	
+	foreach ($NEWTABLE as $table => $sql) {
+		COM_errorLog("Creating {$table} table", 1);
+		DB_query($sql, 1);
+		if (DB_error()) {
+			COM_errorLog("Error Creating {$table} table", 1);
+			plugin_uninstall_dataproxy();
+			return false;
+		}
+		COM_errorLog("Success - Created {$table} table", 1);
+	}
+	
+	// Insert Default Data
+	
+	foreach ($DEFVALUES as $table => $sqls) {
+		COM_errorLog("Inserting default data into {$table} table", 1);
+		
+		foreach ($sqls as $sql) {
+			DB_query($sql, 1);
+			if (DB_error()) {
+				COM_errorLog("Error inserting default data into {$table} table", 1);
+				plugin_uninstall_dataproxy();
+				return false;
+			}
+		}
+		
+		COM_errorLog("Success - inserting data into {$table} table", 1);
+	}
+	
+	// Create the plugin admin security group
+	
+	COM_errorLog("Attempting to create {$pi_name} admin group", 1);
+	DB_query("INSERT INTO {$_TABLES['groups']} (grp_name, grp_descr) "
+		. "VALUES ('{$pi_name} Admin', 'Users in this group can administer the  
{$pi_name} plugin')", 1);
+	if (DB_error()) {
+		plugin_uninstall_dataproxy();
+		return false;
+	}
+	COM_errorLog('...success', 1);
+	$group_id = DB_insertId();
+	
+	// Save the grp id for later uninstall
+	COM_errorLog('About to save group_id to vars table for use during  
uninstall', 1);
+	DB_query("INSERT INTO {$_TABLES['vars']} VALUES  
('{$pi_name}_gid', '{$group_id}')", 1);
+	if (DB_error()) {
+		plugin_uninstall_dataproxy();
+		return false;
+	}
+	COM_errorLog('...success', 1);
+	
+	// Add plugin Features
+	
+	foreach ($NEWFEATURE as $feature => $desc) {
+		COM_errorLog("Adding {$feature} feature", 1);
+		DB_query("INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) "
+			. "VALUES ('{$feature}','{$desc}')", 1);
+		if (DB_error()) {
+			COM_errorLog("Failure adding {$feature} feature", 1);
+			plugin_uninstall_dataproxy();
+			return false;
+		}
+		$feat_id = DB_insertId();
+		COM_errorLog('Success', 1);
+		COM_errorLog("Adding {$feature} feature to admin group", 1);
+		DB_query("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id)  
VALUES ('{$feat_id}', '{$group_id}')");
+		if (DB_error()) {
+			COM_errorLog("Failure adding {$feature} feature to admin group", 1);
+			plugin_uninstall_dataproxy();
+			return false;
+		}
+		COM_errorLog("Success", 1);
+	}
+	
+	/**
+	* OK, now give Root users access to this plugin now!
+	* NOTE: Root group should always be 1
+	*/
+	COM_errorLog("Attempting to give all users in Root group access to  
{$pi_name} admin group", 1);
+	DB_query("INSERT INTO {$_TABLES['group_assignments']} VALUES  
('{$group_id}', NULL, 1)");
+	if (DB_error()) {
+		plugin_uninstall_dataproxy();
+		return false;
+	}
+	
+	// Register the plugin with Geeklog
+	
+	COM_errorLog("Registering {$pi_name} plugin with Geeklog", 1);
+	DB_delete($_TABLES['plugins'], 'pi_name', 'dataproxy');
+	DB_query("INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version,  
pi_gl_version, pi_homepage, pi_enabled) "
+		. "VALUES ('{$pi_name}', '{$pi_version}', '{$gl_version}', '{$pi_url}',  
1)");
+	if (DB_error()) {
+		plugin_uninstall_dataproxy();
+		return false;
+	}
+	
+	COM_errorLog("Succesfully installed the {$pi_name} Plugin!", 1);
+	return true;
+}
+
+/**
+* Main Function
+*/
+$action = COM_applyFilter($_GET['action']);
+if ($action == 'install') {
+	if (plugin_install_dataproxy()) {
+		$msg = 44;
+	} else {
+		$msg = 72;
+	}
+	// Redirects to the plugin editor
+	echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=' . $msg);
+	exit;
+} else if ($action == "uninstall") {
+	if (plugin_uninstall_dataproxy('installed') === true) {
+		$msg = 45;
+	} else {
+		$msg = 73;
+	}
+	// Redirects to the plugin editor
+	echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=' . $msg);
+	exit;
+}
+
+echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php');

Added:  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install_ja.html
==============================================================================
--- (empty file)
+++  
trunk/geeklog-1-jp-extended/public_html/admin/plugins/dataproxy/install_ja.html	 
Thu Sep 11 07:28:52 2008
@@ -0,0 +1,120 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html lang="ja">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+	<meta http-equiv="Content-Style-Type" content="text/css">
+	<title>Geeklog dataproxy プラグインのインストール/アンインストール</title>
+	<style type="text/css">
+	<!-->
+		body {
+			color: black;
+			background-color: white;
+			line-height: 1.5em;
+		}
+		.geeklog {
+			background-color: yellow;
+		}
+		.public {
+			background-color: #99ff00;
+		}
+		.admin {
+			background-color: aqua;
+		}
+		li {
+			padding: 5px 5px 10px 5px;
+		}
+		.fix {
+			color: white;
+			background-color: red;
+			font-weight: bold;
+		}
+		.new {
+			color: white;
+			background-color: green;
+			font-weight: bold;
+		}
+	<! -->
+	</style>
+</head>
+
+<body>
+	<h1>Geeklog dataproxy プラグインのインストール/アンインストール</h1>
+
+	<h2>インストール:</h2>
+	
+	<p>以下の説明で,</p>
+	<ul>
+		<li><span class="geeklog">&lt;geeklog_dir&gt;</span>は,システムの  
config.php が存在するディレクトリ</li>
+		<li><span class="public">&lt;public_html&gt;</span>は,lib-common.php が 
存在するディレクトリ</li>
+		<li><span class="admin">&lt;admin&gt;</span>は,管理者用ファイルが存在す 
るディレクトリ(ふつうは,<span class="public">&lt;public_html&gt;</span>デ 
ィレクトリの下)</li>
+	</ul>
+	<p>を表しています。</p>
+
+	<ol>
+		<li>dataproxy プラグインはテーブルを追加するので,管理者メニューの「DBの 
バックアップ」やphpMyAdminを使用して,事前にGeeklogのデータベースをバックア 
ップしておきます。</li>
+		<li>dataproxyプラグインのアーカイブを<span  
class="geeklog">&lt;geeklog_dir&gt;</span>/pluginsディレクトリに展開します。 
dataproxyという名前のディレクトリができます。</li>
+		<li>adminディレクトリを作ります。<span  
class="admin">&lt;admin&gt;</span>/plugins/ ディレクトリの下にも dataproxyと 
いう名前のディレクトリを作ります。</li>
+		<li><span class="geeklog">&lt;geeklog_dir&gt;</span>/plugins/dataproxy/  
ディレクトリに移動します。adminディレクトリの内容を,3.で作成した <span  
class="admin">&lt;admin&gt;</span>/plugins/dataproxy/ ディレクトリにコピーし 
ます。</li>
+		<li>Rootユーザーとしてログインし,プラグインエディタからインストールを実 
行します。失敗した場合には,エラーログ(error.log)を調べます。この時点 
で,dataproxy プラグインはインストールされ,機能しているはずです。dataproxy  
アイコンをクリックすると,管理機能ページへジャンプするでしょう。</li>
+		<li>セキュリティを設定します。インストール直後には,dataproxyプラグインの 
管理権限を持っているのは,Rootユーザーだけです。ユーザーエディタやグループエ 
ディタを使用して,管理権限を他の人やグループに委譲することができます</li>
+	</ol>
+
+	<h2>アンインストール:</h2>
+
+	<ol>
+		<li>プラグインエディタから,dataproxy プラグインをアンインストールしま 
す。このとき,dataproxyプラグインが使用していたテーブルは破棄され,その中に 
記録されていたデータも削除されます。</li>
+		<li>インストールの過程で作成した2つのディレクトリ(<span  
class="geeklog">&lt;geeklog-dir&gt;</span>/plugins/dataproxy/ と<span  
class="admin">&lt;admin&gt;</span>/plugins/dataproxy/ を削除します。</li>
+	</ol>
+
+	<h2>改訂歴</h2>
+	<table border="1">
+		<tr>
+			<th>バージョン</th>
+			<th>公開日</th>
+			<th>内容</th>
+		</tr>
+		<tr>
+			<td align="right">1.1.1</td>
+			<td>2008-09-11</td>
+			<td>
+				<span class="fix">修正</span> Geeklog-1.5.0に同梱されているアンケートプ 
ラグイン(Polls-2.0.1)でエラーが発生していた問題に対処しました。
+			</td>
+		</tr>
+		<tr>
+			<td align="right">1.1.0</td>
+			<td>2008-08-15</td>
+			<td>
+				<span class="new">新規</span> Geeklog-1.5.0に対応。
+			</td>
+		</tr>
+		<tr>
+			<td align="right">1.0.4</td>
+			<td>2008-05-22</td>
+			<td>
+				<span class="fix">修正</span> 静的ページでURLリライトがオフの場合のパラ 
メータを修正。<br>
+				<span class="fix">修正</span> 静的ページを表示する順序を 
$_SP_CONF['sort_by']を参照するように修正。
+			</td>
+		</tr>
+		<tr>
+			<td align="right">1.0.3</td>
+			<td>2007-12-26</td>
+			<td><span class="fix">修正</span> 多言語機能の扱いを改善。。</td>
+		</tr>
+		<tr>
+			<td align="right">1.0.2</td>
+			<td>2007-12-25</td>
+			<td><span class="fix">修正</span> formmail(静的ページ)を処理しないよう 
修正。</td>
+		</tr>
+		<tr>
+			<td align="right">1.0.1</td>
+			<td>2007-11-10</td>
+			<td><span class="fix">修正</span> drivers/mediagallery.class.phpのカッコ 
閉じ忘れを修正。</td>
+		</tr>
+		<tr>
+			<td align="right">1.0</td>
+			<td>2007-11-04</td>
+			<td>初期公開バージョン。</td>
+		</tr>
+	</table>
+</body>
+</html>




Geeklogjp-changes メーリングリストの案内
Back to archive index