OpenPNEのページに一律でスクリプトを足す方法

JavaScript を全ページに足したいとする。そのときに、どこに足せばよいか?

回答は、OPENPNE_DIR/webapp/modules/pc/templates/inc_html_header.tpl

これにスクリプトを足せばよい。

ためしに、コピペ防止スクリプト

<SCRIPT language=”JavaScript”>
<!–
function right(e) {
if (navigator.appName == ‘Netscape’ && (e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == ‘Microsoft Internet Explorer’ && (event.button == 2 || event.button == 3)) {
return false;
}
return true;
}
function stop() {
return false;
}
document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
document.oncontextmenu=stop;
document.ondragstart=stop;
document.onselectstart=stop;
//–>
</SCRIPT>

を貼ってみたがうまく行っている。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

*

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください