dokuwiki:Setting:CustomizePlugins
7.プラグインのカスタマイズ
dokuwiki\lib\plugins配下を編集
discussion
メール欄の無効化 discussion/action.php
①ハイライト行をコメントアウト
// if(empty($_REQUEST['name']) or empty($_REQUEST['mail'])) return; // don't add anonymous comments
// if(!mail_isvalid($_REQUEST['mail'])) {
// msg($lang['regbadmail'], -1);
// return;
// } else {
$comment['user']['id'] = 'test'.hsc($_REQUEST['user']);
$comment['user']['name'] = hsc($_REQUEST['name']);
$comment['user']['mail'] = hsc($_REQUEST['mail']);
}
// }
②ハイライト行を<!---->で囲う
<!--<div class="comment_mail">
<label class="block" for="discussion__comment_mail">
<span><?php echo $lang['email'] ?>:</span>
<input type="text" class="edit<?php if($_REQUEST['comment'] == 'add' && empty($_REQUEST['mail'])) echo ' error'?>" name="mail" id="discussion__comment_mail" size="50" tabindex="2" value="<?php echo hsc($_REQUEST['mail'])?>" />
</label>
</div>-->
メール欄の廃止 discussion/script.js
①ハイライト行を/**/で囲う
/* if (isBlank(form.mail.value) || form.mail.value.indexOf("@") == -1){
form.mail.focus();
form.mail.style.backgroundColor = '#fcc';
return false;
} else {
form.mail.style.backgroundColor = '#fff';
}*/
Outliner
[管理]-[サイト設定]から以下の項目を有効にする。
・開閉状態をクッキーに保存する
Google Analytics Plugin(プラグインを利用しない設定)
meta.htmlの設置 /lib/tpl/dokuwiki/meta.html
Google Analytics > ホーム > タグの設定手順を確認 > タグの実装手順を表示する と進み
「手動でインストールする」で表示される以下のコードを「meta.html」に張り付ける。
<?php
global $INFO;
if (!$INFO['isadmin']) {
?>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
<?php
}
?>
dokuwiki/Setting/CustomizePlugins.txt · 最終更新: by 127.0.0.1