Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
DefCon system; Please move to the Code Snippets section
Topic Started: Jul 18 2009, 08:34 PM (398 Views)
k arthur90-ZNS
Member
 *  
> Hello there :$
> I'm not much of a coding expert or something, but I just made a code and I think I could share it here :)

> It's a defcon counter. Useful for MMORPG clans since you can set your clan on alert doing this, and you can set 4 different states of alert or (defense conditions, hence the name).

> First, put this on your Style Sheet:

Code:
 
td.defcon {font-color:#000;text-align:center;font-family:arial;font-size:9px;font-weight:bold;}


> Now, put this on your JavaScript Wrapper (this allows quick edition of the link and the defcon status)
Code:
 
<script type="text/JavaScript">
var defcon='1';
var information='1111';
</script>


> At last, you may put this wherever you want your defcon system to appear:
Code:
 

<script type="text/Javascript">
if(defcon==1)
{
document.write('<td class=defcon width="20%" bgcolor="#FFFFFF" ><font color=#000000>1</font></td> <td class=defcon width="20%" bgcolor="#800000" ><font color=#000000>2</font></td> <td class=defcon width="20%" bgcolor="#807000" ><font color=#000000>3</font></td> <td class=defcon width="20%" bgcolor="#008000" ><font color=#000000>4</font></td> <td class=defcon width="20%" bgcolor="#004D80" ><font color=#000000>5</font></td></tr></table><br>');
}
if(defcon==2)
{
document.write('<td class=defcon width="20%" bgcolor="#7F7F7F" ><font color=#000000>1</font></td> <td class=defcon width="20%" bgcolor="#FF0000" ><font color=#000000>2</font></td> <td class=defcon width="20%" bgcolor="#807000" ><font color=#000000>3</font></td> <td class=defcon width="20%" bgcolor="#008000" ><font color=#000000>4</font></td> <td class=defcon width="20%" bgcolor="#004D80" ><font color=#000000>5</font></td></tr></table><br>');
}
if(defcon==3)
{
document.write('<td class=defcon width="20%" bgcolor="#7F7F7F" ><font color=#000000>1</font></td> <td class=defcon width="20%" bgcolor="#800000" ><font color=#000000>2</font></td> <td class=defcon width="20%" bgcolor="#FFDF00" ><font color=#000000>3</font></td> <td class=defcon width="20%" bgcolor="#008000" ><font color=#000000>4</font></td> <td class=defcon width="20%" bgcolor="#004D80" ><font color=#000000>5</font></td></tr></table><br>');
}
if(defcon==4)
{
document.write('<td class=defcon width="20%" bgcolor="#7F7F7F" ><font color=#000000>1</font></td> <td class=defcon width="20%" bgcolor="#800000" ><font color=#000000>2</font></td> <td class=defcon width="20%" bgcolor="#807000" ><font color=#000000>3</font></td> <td class=defcon width="20%" bgcolor="#00FF00" ><font color=#000000>4</font></td> <td class=defcon width="20%" bgcolor="#004D80" ><font color=#000000>5</font></td></tr></table><br>');
}
if(defcon==5)
{
document.write('<td class=defcon width="20%" bgcolor="#7F7F7F" ><font color=#000000>1</font></td> <td class=defcon width="20%" bgcolor="#800000" ><font color=#000000>2</font></td> <td class=defcon width="20%" bgcolor="#807000" ><font color=#000000>3</font></td> <td class=defcon width="20%" bgcolor="#008000" ><font color=#000000>4</font></td> <td class=defcon width="20%" bgcolor="#0099FF"><font color=#000000>5</font></td></tr></tr></table><br>');
}
if (defcon==5)
{
document.write('<font color=#444444>Information</font>');
}
if (defcon<=4)
{
document.write('[color=red]<a href="http://zx.invisionfree.com/FORUM/index.php[/color]?showtopic='+information+'">Information</a>');
</script>


> Now, to set your defcon, you can change the DefCon variable from 1 to 5. The "Information" variable allows you to set to what post does the "Information" link points to (only with Defcons above 5).

> You can (and I suggest you to) put this javascript code on the notepad, save it with an *.ibf extension, upload it on your own forums and use the link you get from "File Management -> Attachments" to save wrapper space.
> If you do that, remember to remove the <script type...> and </script> from the codes.
Edited by k arthur90-ZNS, Jul 18 2009, 09:19 PM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · zIFBoards - Skinning & Code Support · Next Topic »
Add Reply