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

ITDarasgah 06-05-2009 12:21 PM

Install...thanks
this is work at forumhome only...how can set for other Category and section in forum

cionfs 06-05-2009 12:38 PM

Change this code

Code:

<if condition="THIS_SCRIPT == 'index'">
Quote:

Originally Posted by SHER (Post 1823864)
how can set for other Category

Code:

<if condition="THIS_SCRIPT == 'forumdisplay'">

Quote:

Originally Posted by sher
section in forum

Code:

<if condition="THIS_SCRIPT == 'showthread'">

ITDarasgah 06-05-2009 08:22 PM

Quote:

Originally Posted by cionfs (Post 1823875)
Change this code

Code:

<if condition="THIS_SCRIPT == 'index'">


Code:

<if condition="THIS_SCRIPT == 'forumdisplay'">



Code:

<if condition="THIS_SCRIPT == 'showthread'">

Thank you so much...updated

Shadow09 06-06-2009 09:59 AM

It has a lot of W3C validation problems!

cionfs 06-06-2009 10:07 AM

Quote:

Originally Posted by Shadow09 (Post 1824373)
It has a lot of W3C validation problems!

I have not written that is W3C validated :)

accludetuner 06-16-2009 01:11 AM

Anyone else getting an error in IE6?

Quote:

Error: 'document.all.sponsorAdDiv.style' is null or not an object
Tried lowering the security level and disabling script debug errors but I still get the error and pages don't load all the way because of it. It works great on IE7, IE8, Firefox, Safari and Opera. I also think it may be that the IE6 I tried it with is at work and behind a corporate firewall. I haven't heard any complaints from IE6 members about it so I think it just may be my specific machine/firewall setup at work.

cionfs 06-16-2009 06:59 AM

Works fine on IE6,IE7 and IE8 for me. :)

goshalim 07-07-2009 05:59 AM

Thats great !!!

Only a simple question , how do i change the vbulletin logo to my forum logo ?
Thank you

RobbieZ 07-07-2009 06:40 AM

Quote:

Originally Posted by goshalim (Post 1844325)
Thats great !!!

Only a simple question , how do i change the vbulletin logo to my forum logo ?
Thank you

Right click your vbulletin logo and press view image. It will tell you your foum path and filename where the file is.

Either rename your logo to the same name as vbuletin logo and FTP it to the same location and allow overwrite.

Or upload your own image to the images folder and change the filename in admincp>styles & templayes>style manager>(your style)All style options>Image paths

LI_Pets 07-07-2009 11:36 AM

it needs to validate w3c

Log on 09-03-2009 08:49 AM

very niiiiiiice

thank u

Manoel J?nior 09-04-2009 12:17 AM

1 Attachment(s)
Not functionally in Firefox and IE7, IE8:

Attachment 104052

cionfs 09-04-2009 06:43 AM

Have you Java application installed?

elzarie 09-04-2009 08:37 AM

can u make it popup a message to a certain user group ?

cionfs 09-04-2009 09:11 AM

Of course.

Use 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="is_member_of($vbulletin->userinfo, X, X, X)">
<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 -->

Change X, X, X with the usergroup ID's

MrSir 09-14-2009 04:27 PM

Can you put a delay on the pop up say like 3 minute delay?

cionfs 09-14-2009 04:33 PM

3 minutes are 180 seconds.

Change this

Code:

adTime=20;
whith this

Code:

adTime=180;

MrSir 09-14-2009 04:47 PM

Sorry I think I miscommunicated. I am looking to delay the box from opening for about 3 minutes. An average browser on my site is around 10 minutes. So if I could get the box to open up around the 3 minute mark that would be awesome.

cionfs 09-14-2009 04:52 PM

Try using another browser or another computer

apiasto 09-15-2009 12:24 PM

nice idea one question though,can we put our own logo instead of vbulletin.is there a way? thanks

cionfs 09-15-2009 12:32 PM

Obviously, yes.

frank42 09-15-2009 01:24 PM

it will work on /forums.php but not index.php any ideas

frank42 09-15-2009 01:25 PM

in script i have it as

Quote:

<if condition="THIS_SCRIPT == 'index'">

cionfs 09-15-2009 01:37 PM

forums.php and index.php? Have you installed ibproarcade?

frank42 09-15-2009 01:38 PM

yes i have, index is my home page and forums is my forums page

cionfs 09-15-2009 01:50 PM

Your "forum index" is forum.php.

Index.php is "arcade index".

Try this

Code:

<if condition="THIS_SCRIPT == 'arcade'">

frank42 09-15-2009 01:57 PM

nope no go, i will play with it, thanks for the help

frank42 09-15-2009 02:01 PM

heres what i mean

go here which is the main loggin page

then go here

and it works

cionfs 09-15-2009 02:09 PM

Try to change your forum index from vbulletin options.

Waqas Anwar 09-23-2009 01:29 AM

By default my forum logo display at popup window. I want to show here another image (which is a greeting and welcome image). There must a way to do this. Please guide me how can I do this? Thanks


All times are GMT. The time now is 06:05 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.01327 seconds
  • Memory Usage 1,837KB
  • 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
  • (18)bbcode_code_printable
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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