Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-16-2012, 11:10 PM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Warning when leaving to external site

How can I make it like League of Legends' has their external warning set up?
Here is what I mean;
http://na.leagueoflegends.com/board/....php?t=2910177
if you go to that URL, you will see (3rd post) a link. click it and you will see the warning.
You post your link that is NOT on your board.
You click the link
You are leaving blahblah.com!
Press yes to continue, press no to go back
if they press yes, it brings them to the external url. if they press no, it brings them back to our forums (or the page before, whichever)

what is the simplest way to do this? Is there a mod for this?
Reply With Quote
  #2  
Old 12-29-2012, 01:54 AM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump.
Is this possible?
Easy way to do it?
Reply With Quote
  #3  
Old 12-29-2012, 02:15 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try the following:

PHP Code:
<script type="text/javascript">
var 
domain='http://www.jkadhkfakshjdfhkashfdjaksf.com'// Set your domain here.
window.onbeforeunload = function()
{
if(
this.location.href.indexOf(domain)==-1)
{
return 
"Are you sure you want to exit?";
}
}
</
script
Reply With Quote
  #4  
Old 12-29-2012, 02:16 AM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CoffeeLovesYou View Post
Bump.
Is this possible?
Easy way to do it?
A quick google search shows this has been asked here several times since at least 2009, and I found no answers after visiting several of the links.

Have you tried asking that webmaster, using the "contact us" link, how they do it?

I examined their page source code and learned no clues.

HOWEVER, I did find THIS modification that does address this, for vB 3.8.x also using google search:

https://vborg.vbsupport.ru/showthread.php?t=217708

It's described in more detail by the developer here: http://www.websitepublisher.net/two-step/

Scroll down to "About the Plugins" and read that.... I think this is what you're looking for.
Reply With Quote
  #5  
Old 12-29-2012, 02:23 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can also try this one here:

PHP Code:
<html>
<
head>
<
script type="text/JavaScript">
function 
ExitPage()
{
alert ('Before You Leave:\n\n Your messsage here. \n\nMore message text here\n\nMore text here\n\nMore text here');
getit()
}
function 
getit() {
askit confirm("Leaving so soon? Why not stay a little longer!");
if (
askit == true)
alert('Thanks');
else
if (
askit == false)
alert("Visit again soon!");
}
</
script>
</
head>
<
body onbeforeunload="ExitPage();"
Reply With Quote
  #6  
Old 12-29-2012, 05:08 PM
CoffeeLovesYou CoffeeLovesYou is offline
 
Join Date: Feb 2010
Posts: 176
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Max Taxable View Post
A quick google search shows this has been asked here several times since at least 2009, and I found no answers after visiting several of the links.

Have you tried asking that webmaster, using the "contact us" link, how they do it?

I examined their page source code and learned no clues.

HOWEVER, I did find THIS modification that does address this, for vB 3.8.x also using google search:

https://vborg.vbsupport.ru/showthread.php?t=217708

It's described in more detail by the developer here: http://www.websitepublisher.net/two-step/

Scroll down to "About the Plugins" and read that.... I think this is what you're looking for.
Thanks, this worked perfect. I used this instead of what you suggested, CAG, because I wanted this type of redirect, not a JS alert (since not all browsers support)
Thank you though!!
Reply With Quote
Благодарность от:
CAG CheechDogg
  #7  
Old 12-29-2012, 11:41 PM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem buddy.

Question, did you get this to work on vB4 or are you using vB3?

--------------- Added [DATE]1356828126[/DATE] at [TIME]1356828126[/TIME] ---------------

Nevermind ! lol..I didn't see this is posted on vB3 ! lol...I feel dumb !lol
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 11:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04597 seconds
  • Memory Usage 2,234KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (1)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete