The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Follow message

4 posters

Go down

Follow message Empty Follow message

Post by ~PSYDEX~ November 5th 2008, 9:25 pm

Can i add a "follow message" for the unregistered users like here:
http://www.ipmart-forum.it/showthread.php?p=299330
So this message will follow them even when they scroll down ??
I hope you get it??
~PSYDEX~
~PSYDEX~
Forumember

Male Posts : 322
Reputation : 0
Language : Bulgarian
Location : Bulgaria

http://www.mobers.org

Back to top Go down

Follow message Empty Re: Follow message

Post by Guest November 5th 2008, 9:53 pm

Ok now you will only be able to have this on your homepage and only edit the bits I TELL YOU TO EDIT, otherwise the code may not work Smile

1. Navigate to:

Admin Panel\Display\Colors\CSS Stylesheet

2. Add the following code into the white box and press "Submit" to save

Code:
#topbar{
        position:absolute;
        border: 1px solid black;
        padding: 5px;
        background-color: white;
        width: 560px;
        visibility: hidden;
        z-index: 400;
 }

3. Navigate to:

Admin Panel\Display\Generalities\Homepage Content

4. In the "Homepage Message" add the following code

Code:
<head>
<body><script type="text/javascript">
 var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
 var startX = 30 //set x offset of bar in pixels
 var startY = 5 //set y offset of bar in pixels
 var verticalpos="fromtop" //enter "fromtop" or "frombottom"
 
 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.left=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">
 <a href="" onClick="closebar(); return false"><b>X</b></a>
 <font face="arial" color="#000000">ADD YOUR MESSAGE HERE. </font></td>

 </div>
</body>
</head>

5. To add your own message edit the following area from the above code (Which is found at the very bottom)

Code:
<font face="arial" color="#000000">ADD YOUR MESSAGE HERE. </font></td>

6. Press "Save" once your done

This message will now follow you up and down when you scroll, It will stay open until the X is clicked, Once the message is gone it will only come back once the page is refreshed

Regards









Craig


Last edited by Placehold on November 5th 2008, 10:26 pm; edited 2 times in total (Reason for editing : Updated Code - Placehold)
avatar
Guest
Guest


Back to top Go down

Follow message Empty Re: Follow message

Post by ~PSYDEX~ November 5th 2008, 9:58 pm

Thank you !
One more thing . Does it'll dissapear when user register?
In other words i want only unregistered users to see it?
~PSYDEX~
~PSYDEX~
Forumember

Male Posts : 322
Reputation : 0
Language : Bulgarian
Location : Bulgaria

http://www.mobers.org

Back to top Go down

Follow message Empty Re: Follow message

Post by Guest November 5th 2008, 10:05 pm

Hmmm then this will show to everyone, I haven't managed to code it to detect if a user is registered

You can set up a message using the forum widgets to only appear to guests and for it to be hidden to members,

There isn't a way that i could add the same thing to this could because its not actually part of the forum

Regards








Craig
avatar
Guest
Guest


Back to top Go down

Follow message Empty Re: Follow message

Post by ~PSYDEX~ November 5th 2008, 10:12 pm

Hmm... i tryed this code and everything you wrote above and here's what happened - All my forum "chapters" (like Mobile , Music etc.) dissapered!
Where exactly i should put the screen message in the second code?
~PSYDEX~
~PSYDEX~
Forumember

Male Posts : 322
Reputation : 0
Language : Bulgarian
Location : Bulgaria

http://www.mobers.org

Back to top Go down

Follow message Empty Re: Follow message

Post by Guest November 5th 2008, 10:16 pm

That shouldn't happen with this code as this code isn't more than JavaScript in the main homepage message,

The only way they would disappear is if you deleted them or you created a new HTML page and set it to take over as the Homepage

I currently have the exact same code working on my forum without any issues

Regards







Craig
avatar
Guest
Guest


Back to top Go down

Follow message Empty Re: Follow message

Post by ~PSYDEX~ November 5th 2008, 10:18 pm

Seriously!They are gone!When i remove the code from "Generalities" the forums chapters came back!?
And where exactly you sayd to put this part "
Code:
<font face="arial" color="#000000">ADD YOUR MESSAGE HERE. </font></td>
" ? Maybe this is the problem?? Can you give me link to your forum to see how the script looks??
~PSYDEX~
~PSYDEX~
Forumember

Male Posts : 322
Reputation : 0
Language : Bulgarian
Location : Bulgaria

http://www.mobers.org

Back to top Go down

Follow message Empty Re: Follow message

Post by Guest November 5th 2008, 10:24 pm

Strange!!!!!

Now you added the long code into the Homepage Content in generalities?

It shouldn't hide anything, the last part only states what to add to the small pop up,

You remembered to add the CSS for it, yeah?

=> Script In Action

Regards







Craig
avatar
Guest
Guest


Back to top Go down

Follow message Empty Re: Follow message

Post by ~PSYDEX~ November 5th 2008, 10:28 pm

Oh i see...I've been added it at the bottom of other codes in generalities and it should be on top!How dummy HUH? Follow message Guish2

I fixed it but still no pop up message :/
It looks like this:
Follow message Welcometoyouradministraeb5.th
Am i wrong somewhere?
~PSYDEX~
~PSYDEX~
Forumember

Male Posts : 322
Reputation : 0
Language : Bulgarian
Location : Bulgaria

http://www.mobers.org

Back to top Go down

Follow message Empty Re: Follow message

Post by Guest November 5th 2008, 10:30 pm

lol where it says "ADD YOUR MESSAGE HERE. " replace that text with what you want, from text to images and mail links but they must replace "ADD YOUR MESSAGE HERE. "

You should be fine after that Smile

Regards








Craig
avatar
Guest
Guest


Back to top Go down

Follow message Empty Re: Follow message

Post by ~PSYDEX~ November 5th 2008, 10:37 pm

I Changed that
Code:
"ADD YOUR MESSAGE HERE. "
but still no pop up message...
Am i dumb or what? Shocked
~PSYDEX~
~PSYDEX~
Forumember

Male Posts : 322
Reputation : 0
Language : Bulgarian
Location : Bulgaria

http://www.mobers.org

Back to top Go down

Follow message Empty Re: Follow message

Post by Guest November 5th 2008, 10:43 pm

I have replied Via PM with more details and options
Please check your Inbox


***EDIT:

Rectified Via PM

The procedure and code above work
There was a slight conflict with another code


Regards









Craig
avatar
Guest
Guest


Back to top Go down

Follow message Empty Re: Follow message

Post by Nelsaidi November 5th 2008, 11:08 pm

Code:
<font face="arial" color="#000000">ADD YOUR MESSAGE HERE. </font>

^^ Try that )theres no </tld>

Edit: Oh, its fixed i hear? Smile
avatar
Nelsaidi
Forumember

Male Posts : 508
Reputation : 25
Language : English
Location : London,UK

http://forum.erepublik.co.uk

Back to top Go down

Follow message Empty Re: Follow message

Post by ChaosForce December 4th 2008, 3:23 pm

code not works...

can any one fixed the code?
avatar
ChaosForce
Forumember

Posts : 119
Reputation : 0
Language : english

http://techsupport.darkbb.com

Back to top Go down

Follow message Empty Re: Follow message

Post by xxtop March 31st 2009, 3:57 am

hello, can this code be used in forum widgets?
the widgets will follow you when scrolling up and down?
xxtop
xxtop
Forumember

Male Posts : 109
Reputation : 0
Language : English, Filipino
Location : Manila, Philippines

http://one2studios.forum.st

Back to top Go down

Follow message Empty Re: Follow message

Post by ~PSYDEX~ March 31st 2009, 9:14 pm

If you have the code for the widget ...
~PSYDEX~
~PSYDEX~
Forumember

Male Posts : 322
Reputation : 0
Language : Bulgarian
Location : Bulgaria

http://www.mobers.org

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum