vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   warn before navigating away from your website (https://vborg.vbsupport.ru/showthread.php?t=230036)

sailnet 12-12-2009 12:07 PM

warn before navigating away from your website
 
a loser showed up on one of my forums yesterday and posted a link to a hacked website in order to propogate his spyware and a few of my members fell for it.

perhaps this can be done with some javacript, I'm not sure but I'd like to be able to warn people when they click on a link within a thread to check if the destination is off of my site and let them know we have no control over others site and the site might be dangerous.

ideas?

thanks in advance.

Jeff

kh99 12-12-2009 12:42 PM

Well you can do something like:

HTML Code:

<a onclick="return confirm('Danger! You are going away now.\n\nAre you sure?')" href="http://cnn.com">Dangerous Site</a>

and it will pop up one of those "OK Cancel" boxes. But that's the easy part, I think. It's a little harder to figure out how to get it in to any link someone posts.

sailnet 12-12-2009 12:50 PM

Quote:

Originally Posted by kh99 (Post 1929305)
Well you can do something like:

HTML Code:

<a onclick="return confirm('Danger! You are going away now.\n\nAre you sure?')" href="http://cnn.com">Dangerous Site</a>

and it will pop up one of those "OK Cancel" boxes. But that's the easy part, I think. It's a little harder to figure out how to get it in to any link someone posts.

thanks but the code must encapsulate all information in postbit and detect foreign urls from my url. I do not want to warn people going to other urls on my own website.

here's a piece of generic code I found, but it warns on every click and I need to somehow modify it so that it can determine the destination domain, then compare it to my domain and only show the message of the domain names are different.
PHP Code:

<script>

window.onbeforeunload = function (evt) {
var 
message = &#8216;Are you sure you want to leave?’;
if (typeof evt == &#8216;undefined’) {
evt window.event;
}
if (
evt) {
evt.returnValue message;
}
return 
message;
}

</
script


ChopSuey 12-12-2009 05:57 PM

Should have that, thing like MySpace its a bit better.
MSPLINKS thingy.


All times are GMT. The time now is 07:44 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.00982 seconds
  • Memory Usage 1,725KB
  • 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_html_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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