vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Miscellaneous Hacks - Improve registration with popup window (https://vborg.vbsupport.ru/showthread.php?t=214789)

cionfs 05-28-2009 10:00 PM

Improve registration with popup window
 
1 Attachment(s)
Here's a script that makes time for X seconds display a popup window to improve users to register.
The message is shown only for guest when they view forumhome.

Go to AdminCP>Styles & Templates>Search in Templates and fint "header" template.

At the beginning, before all the code, add this code

Code:

<style type="text/css">
<!--
#sponsorAdDiv {position:absolute; height:1; width:1px; top:0; left:0;}
-->
</style>
<script type="text/javascript">


/******************************************
* DHTML Ad Box (By Matt Gabbert at http://www.nolag.com)
* Visit http://www.dynamicdrive.com/ for full script
* This notice must stay intact for use
******************************************/

adTime=20;  // seconds ad reminder is shown
chanceAd=1;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"
adCount=0;
function initAd(){
    if(!ns && !ie && !w3) return;
    if(ie)        adDiv=eval('document.all.sponsorAdDiv.style');
    else if(ns)    adDiv=eval('document.layers["sponsorAdDiv"]');
    else if(w3)    adDiv=eval('document.getElementById("sponsorAdDiv").style');
    randAd=Math.ceil(Math.random()*chanceAd);
        if (ie||w3)
        adDiv.visibility="visible";
        else
        adDiv.visibility ="show";
    if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
    if (ie){documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-20;
    documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;}   
    else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
    documentHeight=window.innerHeight/2+window.pageYOffset-20;}
    else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
    documentHeight=self.innerHeight/2+window.pageYOffset-20;}
    adDiv.left=documentWidth-200+calunit;adDiv.top =documentHeight-200+calunit;
    setTimeout("showAd()",100);}else closeAd();
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}

function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

onload=initAd;
//End-->
</script>
<!-- Inizio script -->
<if condition="$show['guest']">
<if condition="THIS_SCRIPT == 'index'">
<div id="sponsorAdDiv" style="visibility:hidden">
<table width="450px" height="350px" bgcolor="#008000"><tr><td>
<table width="445px" height="345px" bgcolor="#F0FFF0"><tr><td align="center" valign="middle">

<!-- here your message -->
<a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a>
<p><b>Wellcome to $vboptions[bbtitle]</b><br />
Here you'll find everything you need<br />
To be able to use our services you only need to <a href="$vboptions[bburl]/register.php" title="Register to $vboptions[bbtitle]">register</a>.</b>
</p>

<br>

<!-- /here your message -->
</td></tr></table></td></tr></table>
</div>
</if>
</if>
<!-- fine script -->

To change the time, in this example set to 20 seconds, change this

Code:

adTime=20;
and put in its place the seconds that must remain active popup.

To change the message in the popup to change what is between

Code:

<!-- here your message -->
and

Code:

<!--  /here your message -->

Example in attachment. ;)


PS: sorry for my english :D

Original modification in Italian language available here.

Cionfs of Cionfs'Forum CMS

cionfs 05-28-2009 10:19 PM

Reserved :D

TheLastSuperman 05-28-2009 11:04 PM

*Removed, thanks for correcting ;)

(I jumped the gun, sorry :D)

S-MAN

cionfs 05-28-2009 11:13 PM

I am sorry but I past the text as I had inserted in my admincp. :)

Now it is correct with credits. :)

Thank you. :)

Edit: No problem ;)

binaryg 05-29-2009 07:23 PM

Thank you very much, just installed. I'm checking it out. Quick tips though, change "Wellcome" to 'Welcome' and I went ahead and added rel="nofollow" in the link for good measure to prevent sending any bots to the registration page.

I also noticed that if you are using Google AdSense, the pop-up is displayed under the advertisements. To fix this, I modified

PHP Code:

#sponsorAdDiv {position:absolute; height:1; width:1px; top:0; left:0;} 

to

PHP Code:

#sponsorAdDiv {position:absolute; height:1; width:1px; top:0; left:0; z-index: 3;} 

Note, since I am already using a z-index of 2 in the navigation under my header image I chose to make it 3 so you may want to change it to 2 though leaving it as is probably shouldn't hurt.

cionfs 05-30-2009 08:50 AM

Thank you for this tips. :)

sdfaheem 06-01-2009 08:06 AM

How can we make the pop-up align to the left?

cionfs 06-01-2009 10:21 AM

You can try to change this

Code:

<table width="445px" height="345px" bgcolor="#F0FFF0"><tr><td align="center" valign="middle">
with this

Code:

<table width="445px" height="345px" bgcolor="#F0FFF0"><tr><td align="center" valign="left">

sdfaheem 06-01-2009 12:01 PM

Quote:

Originally Posted by cionfs (Post 1821228)
You can try to change this

Code:

<table width="445px" height="345px" bgcolor="#F0FFF0"><tr><td align="center" valign="middle">
with this

Code:

<table width="445px" height="345px" bgcolor="#F0FFF0"><tr><td align="center" valign="left">

Its still not aligning, the page is getting extended to the right.

aliali 06-02-2009 09:45 PM

Thank you very much


All times are GMT. The time now is 10:01 PM.

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.02417 seconds
  • Memory Usage 1,750KB
  • 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
  • (8)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete