Disalow right click for quests
4 posters
Page 1 of 1
Disalow right click for quests
Is there any way to make it so only quests can't right click?
I searched and can't find anything on this
I searched and can't find anything on this
Last edited by DustyBones on April 18th 2011, 12:33 am; edited 1 time in total
Re: Disalow right click for quests
It's only possible to make everyone not right click. <body oncontextmenu="return false"> is the code. In fact, if you made that in a Nav Button that was invisible and only guests are meant to see it, that could work.
Re: Disalow right click for quests
Clug wrote:It's only possible to make everyone not right click. <body oncontextmenu="return false"> is the code. In fact, if you made that in a Nav Button that was invisible and only guests are meant to see it, that could work.
Tried it, didn't work.
Last edited by DustyBones on June 5th 2010, 4:25 pm; edited 2 times in total
Re: Disalow right click for quests
Hello!
Try to paste this code in overall_header_new, right after the tag <head> :
This code will disable right click for guest only!
--------------
Edit : Oh! Sorry, i didn't see you use phpbb 3 version. Those code just use for phpbb2 and punbb only!
Try to paste this code in overall_header_new, right after the tag <head> :
- Code:
<!-- BEGIN switch_user_logged_out -->
<script>
document.onselectstart=new Function("return false");
function ds(e){return false;}
function ra(){return true;}
document.onmousedown=ds;
document.onclick=ra;
document.oncontextmenu=function(){return false};
</script>
<!-- END switch_user_logged_out -->
This code will disable right click for guest only!
--------------
Edit : Oh! Sorry, i didn't see you use phpbb 3 version. Those code just use for phpbb2 and punbb only!
exterminator- Forumember
- Posts : 106
Reputation : 4
Language : English, Japanese, Vietnamese, HTML, Javascript, C, C++, C#, VB.Net
Location : Hochiminh City - Vietnam
Re: Disalow right click for quests
I've not tested it but I think this should work, assuming your navigation bar has the class of navbar.
- Code:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
if ($('div.navbar:contains("Log in")').length > 0) {
$(document).bind("contextmenu",function(e){
return false;
});
}
});
</script>
harvengure- Forumember
- Posts : 86
Reputation : 0
Language : English
Re: Disalow right click for quests
harvengure wrote:I've not tested it but I think this should work, assuming your navigation bar has the class of navbar.
- Code:
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
if ($('div.navbar:contains("Log in")').length > 0) {
$(document).bind("contextmenu",function(e){
return false;
});
}
});
</script>
Wasn't sure where to put this. Tried CSS stylesheet but that of course didn't work.
So I put it in homepage message and that didn't work either
I'm using phpBB3
Re: Disalow right click for quests
Probably want to place the code he said under a navbar thing, like I suggested
Re: Disalow right click for quests
I put it in an announcement so as to apply it across the whole site.
harvengure- Forumember
- Posts : 86
Reputation : 0
Language : English
Re: Disalow right click for quests
DustyBones wrote:Still doesn't work
What do you mean "still doesn't work"? Which code doesn't work?
Last edited by exterminator on June 6th 2010, 4:34 am; edited 1 time in total
exterminator- Forumember
- Posts : 106
Reputation : 4
Language : English, Japanese, Vietnamese, HTML, Javascript, C, C++, C#, VB.Net
Location : Hochiminh City - Vietnam
Re: Disalow right click for quests
My bad. I forgot about the jQuery restrictions...Try the code below...I've tested it on a phpBB3 forum and it works.
- Code:
<script type="text/javascript">
jQuery(document).ready(function() {
if (jQuery('div.navbar:contains("Log in")').length > 0) {
jQuery(document).bind("contextmenu",function(e){
return false;
});
}
});
</script>
harvengure- Forumember
- Posts : 86
Reputation : 0
Language : English
Re: Disalow right click for quests
Wait! I think you should try this way :
Copy all these code below :
Paste it to notepad, save with the name "disablerightclick.js", file type "All file".
Then you upload it to make a direct link.
Ex :
then go to ACP >>> Genaral >>> Forum >>> Configuration
paste this to "Site description" :
Save and test!
P/s : replace "your link.js" with the link that you have upload the js.
Copy all these code below :
- Code:
document.onselectstart=new Function("return false");
function ds(e){return false;}
function ra(){return true;}
document.onmousedown=ds;
document.onclick=ra;
document.oncontextmenu=function(){return false};
Paste it to notepad, save with the name "disablerightclick.js", file type "All file".
Then you upload it to make a direct link.
Ex :
- Code:
http://your link.js
then go to ACP >>> Genaral >>> Forum >>> Configuration
paste this to "Site description" :
- Code:
<script src="http://your link.js" type="text/javascript"></script>
Save and test!
P/s : replace "your link.js" with the link that you have upload the js.
exterminator- Forumember
- Posts : 106
Reputation : 4
Language : English, Japanese, Vietnamese, HTML, Javascript, C, C++, C#, VB.Net
Location : Hochiminh City - Vietnam
Re: Disalow right click for quests
harvengure wrote:My bad. I forgot about the jQuery restrictions...Try the code below...I've tested it on a phpBB3 forum and it works.
Wow, you have tested on phpbb3 version??? How do you paste the code into template????
exterminator- Forumember
- Posts : 106
Reputation : 4
Language : English, Japanese, Vietnamese, HTML, Javascript, C, C++, C#, VB.Net
Location : Hochiminh City - Vietnam
Re: Disalow right click for quests
What I've done with the site I mod for is I use the announcements to make the code apply all the pages. It's in the ACP under General>Messages and Emails>Announcements.
I like jQuery and have used it to hide the original announcements scroller area...just because we have no actual announcements to give at the moment. However should I get the creator of the forum to approve they will remain hidden all the time as I can use jQuery to create a new announcement area anywhere on the page and have it be multi-lined among other things. But anywho, thats how I tested the above code was by pasting it into the announcements. Though it might work from the site description as well...or even work better as done in the post prior to your reply to me.
I like jQuery and have used it to hide the original announcements scroller area...just because we have no actual announcements to give at the moment. However should I get the creator of the forum to approve they will remain hidden all the time as I can use jQuery to create a new announcement area anywhere on the page and have it be multi-lined among other things. But anywho, thats how I tested the above code was by pasting it into the announcements. Though it might work from the site description as well...or even work better as done in the post prior to your reply to me.
harvengure- Forumember
- Posts : 86
Reputation : 0
Language : English
Re: Disalow right click for quests
None worked.
harvengure: I tried the last one you gave me and put it in announcements and still didn't work
I give up. Thanks guys for trying
harvengure: I tried the last one you gave me and put it in announcements and still didn't work
I give up. Thanks guys for trying
Re: Disalow right click for quests
Hmmm. Works on my site....tell you what, link me and I'll see what I can do. In the very least I can view your site and use firebug to make sure that were the code I gave you inserted in the area it would be if I had admin rites, it would work.
harvengure- Forumember
- Posts : 86
Reputation : 0
Language : English
Similar topics
» 12 views, but nobody post help?
» Quests cant see the forum
» blocking quests views
» How to hide links on forum for quests?
» I want this music to appear when they click "right-click"
» Quests cant see the forum
» blocking quests views
» How to hide links on forum for quests?
» I want this music to appear when they click "right-click"
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum