vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Show Thread Enhancements - prevent guest from use the mouse in the pages of threads (https://vborg.vbsupport.ru/showthread.php?t=318604)

hazem_aliraqi 05-08-2015 09:00 PM

prevent guest from use the mouse in the pages of threads
 
1 Attachment(s)
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> 


tanzeelniazi 05-09-2015 05:57 PM

i dont understand can you show the screen shoot

Skyrider 05-10-2015 05:23 AM

Quote:

Originally Posted by tanzeelniazi (Post 2545185)
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?

hazem_aliraqi 05-10-2015 05:50 AM

Quote:

Originally Posted by Skyrider (Post 2545233)
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

Zachery 05-10-2015 11:59 AM

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


All times are GMT. The time now is 03:35 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.01082 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete