Pages: 1

Currently my second code to share.
Ok...Brief Description:
This code allows you to put your profile to an "Under Construction Mode" wherein your viewers will be sent to a new page (but actually its just like a div covering the whole profile). In that so-called page, they can either choose to continue to your profile or leave. This way, visitors will know that your page is only under construction (meaning it could look bad or have alot of errors)
This code is only short but it looks a bit long because I added the guide on implementing it with my Profile Loader w/ fake load info.
End of Description
PREVIEW
http://www.friendster.com/jeueljoseph
Copy the code below inside your onLoad Handler (where the addboxes go):
//Settings
// Is under construction? Y/N
var checkcons = "Y";
//The Under Construction Box content
var ucbox = "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><p align='center'>CURRENTLY UNDER CONSTRUCTION</p><br /><br /><p align='center'><a href='http://www.friendster.com/'>CLICK TO GO HOME</a></p><br /><p align='center'><a href='#' onClick='ucload()'>CLICK HERE TO \"STILL\" PROCEED TO MY PROFILE</p><br />";
// No need to edit below -----------------------------------
if(checkcons=="Y" && pageOwnerID!=pageViewerID){
addBox("LEFT","",ucbox,"ucbox",null);
document.getElementById("mainnav").style.visibility = "hidden";
document.getElementsByTagName("body")[0].style.overflowY = "hidden";
}
Paste this one at the very bottom of your js file:
function ucload(){
document.getElementsByTagName("body")[0].style.overflowY = "auto";
detachThis("ucbox");
}
If you don't have this, paste it at the very bottom of your js:
function detachThis(name){
document.getElementById(name).style.display = "none";
}If you want to make it work with my profile loader
Paste this code inside your onLoad Handler instead (assuming you already have detachThis function):
Edit the variable UCBOX as you like. Just make sure you know what you're doing!
//Settings
// Is under construction? Y/N
var checkcons = "Y";
//The Under Construction Box content
var ucbox = "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><p align='center'>CURRENTLY UNDER CONSTRUCTION</p><br /><br /><p align='center'><a href='http://www.friendster.com/'>CLICK TO GO HOME</a></p><br /><p align='center'><a href='#' onClick='ucload()'>CLICK HERE TO \"STILL\" PROCEED TO MY PROFILE</p><br />";
// No need to edit below -----------------------------------
if(checkcons=="Y" && pageOwnerID!=pageViewerID){
addBox("LEFT","",ucbox,"ucbox",null);
document.getElementById("mainnav").style.visibility = "hidden";
document.getElementsByTagName("body")[0].style.overflowY = "hidden";
} else {
var loadpage = "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><p align='justify'>LOADING PROFILE<span style='text-decoration:blink;'>...</span></p><br /><img src='URL OF LOADING PIC' alt='loading' /><br /><br /><p align='justify' id='loadtext'></p>";
addBox("LEFT","",loadpage,"loadpage",null);
var loadst = setTimeout("detachThis('loadpage')",3000);
var lfunc = new Array();
lfunc[0] = setTimeout("changeContent('LOADING TEXT 1')",1000);
lfunc[1] = setTimeout("changeContent('LOADING TEXT 2')",2000);
lfunc[2] = setTimeout("changeContent('LOADING TEXT 3')",3000);
}Just replace the code inside if(checkcons=="N"){} with "the profile loader code inside your onload handler".
And paste this version of ucload() instead:
function ucload(){
document.getElementById("mainnav").style.visibility = "visible";
document.getElementsByTagName("body")[0].style.overflowY = "auto"
detachThis("ucbox");
var loadpage = "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><p align='justify'>LOADING PROFILE<span style='text-decoration:blink;'>...</span></p><br /><img src='URL OF LOADING PIC' alt='loading' /><br /><br /><p align='justify' id='loadtext'></p>";
addBox("LEFT","",loadpage,"loadpage",null);
var loadst = setTimeout("detachThis('loadpage')",3000);
var lfunc = new Array();
lfunc[0] = setTimeout("changeContent('LOADING TEXT 1')",1000);
lfunc[1] = setTimeout("changeContent('LOADING TEXT 2')",2000);
lfunc[2] = setTimeout("changeContent('LOADING TEXT 3')",3000);
}Again, Just replace the code below detachThis("ucbox"); with "the profile loader code inside your onload handler".
BTW, just configure var checkcons into either "Y" or "N"(Y= yes, the profile is under construction || N=no, profile is not under construction)
Lastly, paste this into your css extension:
#ucbox {
opacity: 1.0;
-moz-opacity: 1.0;
filter:alpha(opacity=100);
background: #HEX CODE;
position: fixed;
width: 1024px;
height: 768px;
top: 0px;
left: 0px;
z-index: 20000;
}
#ucbox h2 {
display:none;
}Leave questions here or comment it in my profile!
Last edited by briskicetea (2008-08-31 06:42:13)

-Offline- |

FIRST ONE TO COMMENT HERE
THANKS FOR SHARING
-Offline- |

can u pls... gv a brief description bout this 


Edited. Added the Brief Description. Hope its clear enough

-Offline- |

Nice one for a new comer like you buddy...nice script indeed..![]()
i got my own style as well..
-Offline- |

ayt i got it... i tot ur... sayin dat this topic is
under cons. haha .nice 1


thx. i'll try to share more

-Offline- |
this trick works for all browsers?
-Offline- |

nice trick! i will try this next time.. thanks for sharing..

-Offline- |

All I'm sure of is that it works on FF 2+
I just need helping confirming that it's cross-browser from other ftalkers.
But the code looks nothing special for it not to work on IE .

-Offline- |

sry, i didnt get it
wud do eu mean by "the profile loader code inside your onload handler" ??
which code?
can eu gimme examples?
-Offline- |
nice one dude
![]()
-Offline- |

nice guys 

thanks for share
i like it


-Offline- |
haizzz.. nOt working in Ie
-Offline- |

tnx 4 sharng..
-Offline- |
Pages: 1