Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
prevent guest from use the mouse in the pages of threads Details »»
prevent guest from use the mouse in the pages of threads
Version: 1.00, by hazem_aliraqi hazem_aliraqi is offline
Developer Last Online: Aug 2019 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 4.2.x Rating:
Released: 05-08-2015 Last Update: Never Installs: 2
Template Edits
 
No support by the author.

hello


this code for prevent guest from use the mouse in the pages of threads

so this code is work only in thread pages

and i find it work with Google Chrome , Firefox, Enternet


just add this at the end of headinclude template


this code with out alert
PHP Code:

<vb:if condition="$show['guest']">
<
vb:if condition="THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'threads'">
<
script>
 var 
isNS = (navigator.appName) ? 0;
  if(
navigator.appName == "Netscape"document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
  function 
mischandler(){
   return 
false;
 }
  function 
mousehandler(e){
     var 
myevent = (isNS) ? event;
     var 
eventbutton = (isNS) ? myevent.which myevent.button;
    if((
eventbutton==1)||(eventbutton==3))  return false;
 }
 
document.oncontextmenu mischandler;
 
document.onmousedown mousehandler;
 
document.onmouseup mousehandler;
    </
script></vb:if> </vb:if> 

if you want to add alert to appear for guest use that code



PHP Code:
<vb:if condition="$show['guest']">

<
vb:if condition="THIS_SCRIPT == 'showthread' OR THIS_SCRIPT == 'threads'">

<
script>
 var 
isNS = (navigator.appName) ? 0;
  if(
navigator.appName == "Netscape"document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
  function 
mischandler(){
   return 
false;
 }
  function 
mousehandler(e){
     var 
myevent = (isNS) ? event;
     var 
eventbutton = (isNS) ? myevent.which myevent.button;
    if((
eventbutton==1)||(eventbutton==3)) alert(" Sorry you cannot use shading and copies in threads only after you register  "); return false;
 }
 
document.oncontextmenu mischandler;
 
document.onmousedown mousehandler;
 
document.onmouseup mousehandler;
    </
script></vb:if> </vb:if> 

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-09-2015, 05:57 PM
tanzeelniazi tanzeelniazi is offline
 
Join Date: Apr 2012
Posts: 375
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i dont understand can you show the screen shoot
Reply With Quote
  #3  
Old 05-10-2015, 05:23 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tanzeelniazi View Post
i dont understand can you show the screen shoot
Quote:
if((eventbutton==1)||(eventbutton==3)) return false;
By looking at that code, it blocks the first and second (left and right) mouse buttons. How do you expect guests to return to eg, home screen if their mouse buttons is being blocked?
Reply With Quote
  #4  
Old 05-10-2015, 05:50 AM
hazem_aliraqi's Avatar
hazem_aliraqi hazem_aliraqi is offline
 
Join Date: Oct 2010
Location: iraq
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Skyrider View Post
By looking at that code, it blocks the first and second (left and right) mouse buttons. How do you expect guests to return to eg, home screen if their mouse buttons is being blocked?


just use the code without alert
Reply With Quote
  #5  
Old 05-10-2015, 11:59 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Why would you even expect users to stay on your site?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:41 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04142 seconds
  • Memory Usage 2,277KB
  • Queries Executed 19 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete