• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Hướng dẫn Cấm khách right mouse khi xem bài Xenforo

shirauno

New Member
Vào template -> page_container_js_head

Thêm đoạn code sau vào cuối



<xen:if is="!{$visitor.user_id}">
<script type="text/javascript">
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Right click is disabled for guests!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>
</xen:if>

Thay đổi nội dung 2 đoạn này theo ý bạn -> Nội dung báo lỗi khi khách phải chuột.


var message="Right click is disabled for guests!";

var message="Your custom message here";
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top