- [[PHP]]のHTTP認証云々のところの解決策と同様
- index.phpはPKWK_READONLYを指定して、通常閲覧用
- editable.phpは.htaccessでアクセス制限、管理用

* comment だけ許可

これだと editable でない方でコメントを付けたときに日付が更新されない。~

index.php
 define('PKWK_ALLOW_COMMENT', 1);

plugin/comment.inc.php
 if (PKWK_READONLY)

 if (PKWK_READONLY && !PKWK_ALLOW_COMMENT)

 page_write($vars['refer'], $postdata);

 page_write($vars['refer'], $postdata, FALSE, TRUE);


lib/file.php
 function page_write($page, $postdata, $notimestamp=FALSE, $allow_write=FALSE)
     if (PKWK_READONLY && !(PKWK_ALLOW_COMMENT && $allow_write)) return; // Do nothing
     file_write(DIFF_DIR, $page, $diffdata, $notimestamp, $allow_write);
     file_write(DATA_DIR, $page, $postdata, $notimestamp, $allow_write);
 function file_write($dir, $page, $str, $notimestamp=FALSE, $allow_write=FALSE)
     if (PKWK_READONLY && !(PKWK_ALLOW_COMMENT && $allow_write)) return; // Do nothing
     put_lastmodified(PKWK_ALLOW_COMMENT && $allow_write);
 function put_lastmodified($ignore_readonly=FALSE)
     if (PKWK_READONLY && !$ignore_readonly) return; // Do nothing


トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS