Author Topic: MOD: Animated bar for GUESTS to register  (Read 11600 times)

jayjota

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1421
MOD: Animated bar for GUESTS to register
« on: January 06, 2009, 11:12:58 AM »
Hello all,
This MOD is useful to help turn guests to register as members.
What it does? This script mimics the interface of the IE ActiveX information bar that slides into view from the top of the browser in displaying information to your visitors in a eye catching way! The bar slides in view and remains static on the screen even when the user scrolls the page.


First things first, open up /classes/sessions.php and insert the following:
Quote
if ($_SESSION["user_id"] != ""){
}
else {
$show_visitor_div = 1;
}

now open up /templates/main_1.htm and insert the following after <body class="MainBody"> :
Quote
<div><style type="text/css">

#informationbar{
position: fixed;
left: 0;
width: 100%;
text-indent: 5px;
padding: 5px 0;
background-color: lightyellow;
border-bottom: 1px solid black;
font: bold 12px Verdana;
}

* html #informationbar{ /*IE6 hack*/
position: absolute;
width: expression(document.compatMode=="CSS1Compat"? document.documentElement.clientWidth+"px" : body.clientWidth+"px");
}

</style>

<script type="text/javascript">
function informationbar(){
   this.displayfreq="always"
   this.content='<a href="javascript:informationbar.close()"><img src="close.gif" style="width: 14px; height: 14px; float: right; border: 0; margin-right: 5px" />[/url]'
}

informationbar.prototype.setContent=function(data){
   this.content=this.content+data
   document.write('<div id="informationbar" style="top: -500px">'+this.content+'</div>')
}

informationbar.prototype.animatetoview=function(){
   var barinstance=this
   if (parseInt(this.barref.style.top)<0){
      this.barref.style.top=parseInt(this.barref.style.top)+5+"px"
      setTimeout(function(){barinstance.animatetoview()}, 50)
   }
   else{
      if (document.all && !window.XMLHttpRequest)
      this.barref.style.setExpression("top", 'document.compatMode=="CSS1Compat"? document.documentElement.scrollTop+"px" : body.scrollTop+"px"')
   else
      this.barref.style.top=0
   }
}

informationbar.close=function(){
   document.getElementById("informationbar").style.display="none"
   if (this.displayfreq=="session")
      document.cookie="infobarshown=1;path=/"
}

informationbar.prototype.setfrequency=function(type){
   this.displayfreq=type
}

informationbar.prototype.initialize=function(){
   if (this.displayfreq=="session" && document.cookie.indexOf("infobarshown")==-1 || this.displayfreq=="always"){
      this.barref=document.getElementById("informationbar")
      this.barheight=parseInt(this.barref.offsetHeight)
      this.barref.style.top=this.barheight*(-1)+"px"
      this.animatetoview()
   }
}

window.onunload=function(){
   this.barref=null
}

</script>


<script type="text/javascript">
<!--Invocation code-->

var infobar=new informationbar()
infobar.setContent('Welcome to XXXXXMYVIDEOSITEXXXXX It appears you are not registered yet on our site. Why wait? <a href="login.php">Register here[/url]')
//infobar.setfrequency('session') //
infobar.initialize()

</script>
<!--[onload_371;block=div;when [var.show_visitor_div]=1;comm]-->
</div>

Just change where it says XXXXXMYVIDEOSITEXXXXX to the name of your own video site.

Now, you will also need to download and upload the image attached in this thread called close.gif

Please let me know if this was useful to you, as I have a few more tricks up my sleeve!

« Last Edit: January 06, 2009, 11:14:51 AM by jayjota »

jayjota

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1421
Re: MOD: Animated bar for GUESTS to register
« Reply #1 on: January 06, 2009, 01:24:59 PM »
alright, let me know when your done to see how it came out on your site...

Sarvnaa

  • V3 Beta Tester
  • Sr. Member
  • *
  • Posts: 156
    • Saromama - Kids world
Re: MOD: Animated bar for GUESTS to register
« Reply #2 on: January 06, 2009, 04:18:53 PM »
Hello Jay,
   Thanks for your mod.


thx
saro
« Last Edit: January 06, 2009, 04:23:27 PM by Sarvnaa »

jayjota

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1421
Re: MOD: Animated bar for GUESTS to register
« Reply #3 on: January 06, 2009, 04:35:49 PM »
Hello Jay,
   Thanks for your mod.


thx
saro

I see it came out well on your site, I do not however see the close image.....
It matched up nicely though :-)

Sarvnaa

  • V3 Beta Tester
  • Sr. Member
  • *
  • Posts: 156
    • Saromama - Kids world
Re: MOD: Animated bar for GUESTS to register
« Reply #4 on: January 06, 2009, 06:59:00 PM »
>Modified code to move the bar down!

Paste the code immediately below <body>

Quote

<style type="text/css">
#topbar
{   
   PADDING-TOP: 5px;
   PADDING-BOTTOM: 5px;
   PADDING-RIGHT: 5px;
   PADDING-LEFT: 5px;
   VISIBILITY: hidden;
   BORDER-TOP: black 1px solid;
   BORDER-BOTTOM: black 1px solid;
   BORDER-RIGHT: black 1px solid;
   BORDER-LEFT: black 1px solid;
   WIDTH: 450px;
   FONT-FAMILY: Tahoma;
   POSITION: absolute;
   BACKGROUND-COLOR: white
}
</style>

<script type="text/javascript">
var persistclose = 1
var startX = 3
var startY = 3
var verticalpos = "fromtop"
 
function iecompattest()
{
   return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
 
function get_cookie(Name)
{
   var search = Name + "="
   var returnvalue = "";
   if (document.cookie.length > 0)
   {
      offset = document.cookie.indexOf(search)
      if (offset != -1)
      {
         offset += search.length
         end = document.cookie.indexOf(";", offset);
         if (end == -1) end = document.cookie.length;
         returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
   return returnvalue;
}
 
function closebar()
{
   if (persistclose)
   document.cookie="remainclosed=1"
   document.getElementById("topbar").style.visibility="hidden"
}
 
function staticbar()
{
   barheight=document.getElementById("topbar").offsetHeight
   var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
   var d = document;
   function ml(id)
   {
      var el=d.getElementById(id);
      if (!persistclose || persistclose && get_cookie("remainclosed")=="")
      el.style.visibility="visible"
      if(d.layers)el.style=el;
      el.sP=function(x,y){this.style.right=x+"px";this.style.top=y+"px";};
      el.x = startX;
      if (verticalpos=="fromtop")
         el.y = startY;
      else
      {
         el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
         el.y -= startY;
      }
      return el;
   }
   
   window.stayTopLeft=function()
   {
      if (verticalpos=="fromtop")
      {
         var pY = ns ? pageYOffset : iecompattest().scrollTop;
         ftlObj.y += (pY + startY - ftlObj.y)/8;
      }
      else
      {
         var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
         ftlObj.y += (pY - startY - ftlObj.y)/8;
      }
      ftlObj.sP(ftlObj.x, ftlObj.y);
      setTimeout("stayTopLeft()", 10);
   }
   ftlObj = ml("topbar");
   stayTopLeft();
}
 
if (window.addEventListener)
   window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
   window.attachEvent("onload", staticbar)
else if (document.getElementById)
   window.onload=staticbar
</script>
 
<div id="topbar">
   <table width="100%">
      <tr>
         <td width="99%">
               You are Unregistered, please <a href="/login.php">register[/url] to gain Full access.&nbsp;&nbsp;&nbsp;&nbsp; </td><td width="1%"><a onclick="closebar(); return false" href="Yoursite name"><img style="float: left" src="http://www.saromama.com/images/close1.gif" border="0">[/url]
         </td>
      </tr>
   </table>
</div>




check my site for demo : www.saromama.com




Elrik007

  • Newbie
  • *
  • Posts: 17
Re: MOD: Animated bar for GUESTS to register
« Reply #5 on: January 06, 2009, 11:25:06 PM »
Thanks you very mutch it's work's Great!


demo at: http://www.showmewithvideo.com

jayjota

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1421
Re: MOD: Animated bar for GUESTS to register
« Reply #6 on: January 08, 2009, 11:38:49 AM »
Thanks you very mutch it's work's Great!


demo at: http://www.showmewithvideo.com

no problem, I am glad to hear that!
I hope it works well for you, I seen an increase in membership ratio, it has doubled since using this....

Sarvnaa

  • V3 Beta Tester
  • Sr. Member
  • *
  • Posts: 156
    • Saromama - Kids world
Re: MOD: Animated bar for GUESTS to register
« Reply #7 on: January 09, 2009, 02:57:41 AM »
Thanks you very mutch it's work's Great!


demo at: http://www.showmewithvideo.com

no problem, I am glad to hear that!
I hope it works well for you, I seen an increase in membership ratio, it has doubled since using this....


Jay.. U r right.. yesterday 8 members registered in my site.


@arutkow

   1. Normally it should not, have to check the code again.
   2. Yoursite name means like www.clamshare.com


jayjota

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1421
Re: MOD: Animated bar for GUESTS to register
« Reply #8 on: January 11, 2009, 08:48:56 AM »
Ok, I think I got it installed.  Check it out at:

http://www.ClamShare.com

However, I have 2 questions:

1)  Should it still whow up after I login?

2)  What does adding my saite name here
Quote
false" href="Yoursite name"><img st
  do?


Thanks,

-Abram

1.) No, It will NOT show up after you log-in the <div> will disappear. At least with the one I did, however the one that Sarvnaa just modified I cannot speak for, as I do not see the same <div> code to onload only for guests and to disappear during a registered member is logged in.

2.) I imagine you are speaking of the one that Sarvnaa modified, and it seems like the href link will take you there once the person presses the close icon.

mohdaftab

  • Guest
Re: MOD: Animated bar for GUESTS to register
« Reply #9 on: January 11, 2009, 10:50:29 AM »
Thanks works great, very nice mod.

BurundiLive

  • Newbie
  • *
  • Posts: 65
Re: MOD: Animated bar for GUESTS to register
« Reply #10 on: January 11, 2009, 11:04:37 AM »
Thanx for the mod.

ParaStorm

  • Newbie
  • *
  • Posts: 11
Re: MOD: Animated bar for GUESTS to register
« Reply #11 on: January 12, 2009, 05:09:07 PM »
Thank you very much! Very easy and helpful!


upena

  • Guest
Re: MOD: Animated bar for GUESTS to register
« Reply #12 on: February 01, 2009, 12:58:14 AM »
Many thanks for the mod.  Before the mod - I was getting one to two sign-ups per week.  now I am getting 20-25 - works great.

thanks again.

lar

sbcjr

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6237
    • PHPmotion Mods
Re: MOD: Animated bar for GUESTS to register
« Reply #13 on: February 02, 2009, 01:19:37 PM »
Awesome mod, thanks, jayjota!

2pac

  • Newbie
  • *
  • Posts: 50
    • Music 4 Tube
Re: MOD: Animated bar for GUESTS to register
« Reply #14 on: February 02, 2009, 01:44:40 PM »
yeahhh very good mod jayjota Thanks :D:D

david.