Forum Url:
http://qub1.smfforfree.comHi, and good day to you all
. Today I present you one of my newest codes, it's a code witch allows you to create a alert of your choise! You can use it to report if a banned user has posted or anything else.
There is a live preview of the code on the above site, this post can also be found there.Ok, first this is the code:
<script LANGUAGE="JavaScript">
<!-- This script is made by Qub1. Find more scripts like this at http://qub1.smfforfree.com/ -->
var qub1_mess = 'PUT THE TEXT YOU WANT TO APPEAR HERE';
var qub1_background = '#D8D8D8'
var qub1_bordure = '#000000'
var qub1_police = 'Verdana'
var qub1_police_taille = '12'
var qub1_police_color = '#000000'
var qub1_hauteur = 120
var qub1_largeur = 340
var qub1_box2 = 1;
qub1_classe = 'border-color:'+qub1_bordure+';border-style:solid;border-width:1px;background:'+qub1_background+';font-family:'+qub1_police+';font-size:'+qub1_police_taille+'px;color:'+qub1_police_color;
if(document.getElementById)
{
document.write('<DIV ID=qub1_box1 STYLE="position:absolute;visibility:hidden;'+qub1_classe+';width:20;height:'+(qub1_hauteur+20)+';z-index:10"></DIV>');
document.write('<DIV ID=qub1_box2 STYLE="position:absolute;visibility:hidden;'+qub1_classe+';width:'+qub1_box2+';height:'+qub1_hauteur+';z-index:5');
if(document.all)
document.write(';padding:10');
document.write('"></DIV>');
document.write('<DIV ID=qub1_box3 STYLE="position:absolute;visibility:hidden;'+qub1_classe+';width:20;height:'+(qub1_hauteur+20)+';z-index:10"></DIV>');
qub1_Y = document.body.clientHeight;
qub1_X = document.body.clientWidth;
qub1_posX = Math.round(qub1_X/2);
qub1_posY = Math.round(qub1_Y/2)-Math.round(qub1_hauteur/2);
}
function qub1_deplace()
{
document.getElementById("qub1_box1").style.left = qub1_posX-20-(qub1_box2/2);
document.getElementById("qub1_box3").style.left = qub1_posX+(qub1_box2/2);
document.getElementById("qub1_box2").style.left = qub1_posX-(qub1_box2/2)-5;
document.getElementById("qub1_box2").style.width = qub1_box2+10;
qub1_box2 += 5;
if(qub1_box2<qub1_largeur)
setTimeout("qub1_deplace()",10);
else
{
document.getElementById("qub1_box2").innerHTML = '<CENTER>'+qub1_mess+'<BR><BR><B><A HREF=javascript:qub1_close()><FONT COLOR='+qub1_police_color+'>Close Warning</FONT></A></B></CENTER>'
}
}
function qub1_start()
{
if(document.getElementById)
{
document.getElementById("qub1_box1").style.visibility = 'visible'
document.getElementById("qub1_box2").style.visibility = 'visible'
document.getElementById("qub1_box3").style.visibility = 'visible'
document.getElementById("qub1_box1").style.top = qub1_posY-10
document.getElementById("qub1_box2").style.top = qub1_posY
document.getElementById("qub1_box3").style.top = qub1_posY-10
qub1_deplace();
}
}
function qub1_close()
{
if(document.getElementById)
{
document.getElementById("qub1_box1").style.visibility = 'hidden'
document.getElementById("qub1_box2").style.visibility = 'hidden'
document.getElementById("qub1_box3").style.visibility = 'hidden'
document.getElementById("qub1_box1").style.top = -600
document.getElementById("qub1_box2").style.top = -600
document.getElementById("qub1_box3").style.top = -600
qub1_deplace();
}
}
window.onload = qub1_start;
</script>
Ok, now put the code in the footers, or if you would like to put it on a random page put it in your so called <body>.
If you want to use it as a warning for a user, or as a user alert as I did on my site, just put the BBC code for html before and after the code (like this "[htm]thecode[/htm]" (I left out the "l"s bacause else it would be a script) and put it in the signature.
Now this is what you need to edit:
You can replace the
PUT THE TEXT YOU WANT TO APPEAR HERE text with your own. You can find it here:
var qub1_mess = 'PUT THE TEXT YOU WANT TO APPEAR HERE';
^^ To edit the above, you need to have a little HTML knowledge. To go down one row, use " <br> ". To insert a Hyperlink, use "<a href="THE LINK HERE">YOUR HYPERLINK TEXT HERE</a>". If you want to insert something else, just ask, and I will give the code.
Oh, and if you need it, here are the codes I used for my site:
Banned User Warning:
var qub1_mess = '<b>~WARNING~</b> <br> You are on a page where a banned-user has posted. If there is any abusive content I cannot be held responsible. <br> <br> <b>Users Information:</b> <br> Username: Banned <br> <br> <b>What do you want to do?</b> <br> <a href="http://qub1.smfforfree.com/index.php?action=profile;u=2">Vieuw his Userpage</a> <br> <input TYPE="button" VALUE="Go back" onClick="history.go(-1);">';
Admin Menu Alert (this one has some bugs with the Fame |+| and Defame |-| options, if anyone would like to fix that
):
var qub1_mess = '<b><p style="color:gold">~Administrator~</p></b> <br> You are on a page where the Administrator has posted. <br> <br> <b>Users Information:</b> <br> Username: Qub1 <br> <br> <b>What do you want to do?</b> <br> <a href="http://qub1.smfforfree.com/index.php?action=profile;u=1">View Profile</a> <br> <a href="http://qub1.smfforfree.com/index.php?action=pm;sa=send;u=1">Send PM</a> <br> <a href="mailto:Qub1@hotmail.com">Send E-mail</a> <br> <a href="http://qub1.smfforfree.com/index.php?action=modifykarma;sa=applaud;uid=1">Fame |+|</a> <br> <a href="http://qub1.smfforfree.com/index.php?action=modifykarma;sa=smite;uid=1">Defame |-|</a> <br> <a href="http://qub1.smfforfree.com/index.php?action=comment;sa=add;u=1">Comment User</a> <br> <a href="http://qub1.smfforfree.com/index.php?action=profile;u=1;sa=showPosts">Show Posts</a> <br> <input TYPE="button" VALUE="Go back" onClick="history.go(-1);">';
You may edit them to fit your needs.
You will also need to edit the look of the alert. You may use my
Hexadecimal Color Topic for the colors, located on my site, and the rest is kind of self explainatory. The part you need to edit looks like this:
var qub1_background = '#D8D8D8'
var qub1_bordure = '#000000'
var qub1_police = 'Verdana'
var qub1_police_taille = '12'
var qub1_police_color = '#000000'
var qub1_hauteur = 120
var qub1_largeur = 340
Now for the last little thing you can edit is the little text at the bottom of the alert witch will close the alert when it is clicked. You can find it here:
document.getElementById("qub1_box2").innerHTML = '<CENTER>'+qub1_mess+'<BR><BR><B><A HREF=javascript:qub1_close()><FONT COLOR='+qub1_police_color+'>Close Warning</FONT></A></B></CENTER>'
Just edit the Red text to what you want.
If you have any questions or comments, please post, i am always open to new problems or solutions
Thanks for reading, and if you are going to use it, thanks for using!
~ Qub1