Advertise Here

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Qub1

Pages: [1] 2 3 4 5
1
General Chat / How was SMFFORFREE made?
« on: July 10, 2009, 09:23:17 am »
I would like to know what codes you used and what host to set up SMFFORFREE, because I would like to make my own Forum host too. Is there a way? Like some tutorial explaining?

2
Advertise Your Board / ~~// RunePray \\~~
« on: March 23, 2009, 01:38:30 am »
Forum Url: http://runepray.smfforfree.com
This is a new version of my old RunePray forum, and this one is all about RuneScape, Private Servers, Weapons, Accounts, Hints, Tips, and much more. So visit now!

Oh, if you visit, you can become staff member by pmming Qub1, then saying what you want to be, mod, glob. mod, etc...

www.runepray.smfforfree.com
Forum Info:

3
Code Requests / Users online
« on: March 12, 2009, 07:50:37 am »
Forum Url: http://runepray.smfforfree.com
could someone make a code just like the one that shows how many new pm's you have that shows how many users there are currently online? I don't want it to have a background, like the one of the pm's, i want it to be just text. THANKS  :D

4
SMF For Free Codes and Support / 3 small little problems...
« on: March 12, 2009, 06:52:06 am »
Forum Url: http://runepray.smfforfree.com
I have made a Runescape forum, but im having a little problem with it... Here is an image of it:


As you see, the second image, wich consists of 2 images, is split-up, so you can see it are two images. For those images i use a mouse-over function, here is the code i use:
Code: [Select]
<head><SCRIPT LANGUAGE="JavaScript">
<!-- Begin
loadImage2 = new Image();
loadImage2.src = "http://www.smfforfree.com/gallery/runepray/1_12_03_09_6_28_42.bmp";
staticImage2 = new Image();
staticImage2.src = "http://www.smfforfree.com/gallery/runepray/1_12_03_09_6_33_46.bmp";

loadImage3 = new Image();
loadImage3.src = "http://www.smfforfree.com/gallery/runepray/1_12_03_09_6_29_07.bmp";
staticImage3 = new Image();
staticImage3.src = "http://www.smfforfree.com/gallery/runepray/1_11_03_09_1_48_31.bmp";

// End -->
</script></head>

<a href="http://runepray.smfforfree.com/index.php?action=login" onmouseover="image2.src=loadImage2.src;" onmouseout="image2.src=staticImage2.src;">
<img name="image2" src="http://www.smfforfree.com/gallery/runepray/1_12_03_09_6_33_46.bmp" border=0></a>

<a href="http://runepray.smfforfree.com/index.php?action=login" onmouseover="image3.src=loadImage3.src;" onmouseout="image3.src=staticImage3.src;">
<img name="image3" src="http://www.smfforfree.com/gallery/runepray/1_11_03_09_1_48_31.bmp" border=0></a>

If somebody could fix it so that the two images are together, without some space between them, thanks.


My second problem is the block-background behind the images (the light-grey color). I want the images to have no background at all, that they are floating on the page. Could someone tell me what to do in the CSS code, or give me a code that makes the blocks transparent?


And now my last issue, as you can see the two images are just outsite the scroll (the paper on the background). I want them to be inside the scroll area, that looks nicer  ;D.

Thanks!

5
SMF For Free Codes and Support / [HELP] Linking to JS codes
« on: March 06, 2009, 10:09:46 am »
Ok, i've seen Agent Moose and others having this in their codes:
Code: [Select]
<script src=blahblahblah.com></script>And I have found a site that hosts JS files, and gives the code to use my js shortcut, but somehow its not working. This is the code i use:
Code: [Select]
<script type="text/javascript" src="http://javascripthost.com/s1/bin/Forebidden-Words.js"></script>

6
Forum Url: http://qub1.smfforfree.com
Hi, and good day to you all ;D. 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:
Quote
<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:
Code: [Select]
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:
Quote
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 ;)):
Quote
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:
Code: [Select]
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:
Quote
      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  ;D
Thanks for reading, and if you are going to use it, thanks for using!
~ Qub1

7
I am using this code:
Code: [Select]
<script LANGUAGE="JavaScript">
<!-- This script is made by Qub1. Find more scripts like this at http://qub1.smfforfree.com/ -->
 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);">';
 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>

Can someone modify the code so that it will only run once per browser session?

Oh, and use cookies plz  ;D
NO PHP  :police:

Thanks

8
SMF For Free Codes and Support / [CODE] Changing WEBPAGE Title
« on: January 01, 2009, 08:51:45 am »
NOTE: Currently no previeuw, maybe later...

Ok, here is another code i made, it will change the Webpage title from time to time, you can choose how long. Here's the code (the eitable part is below it:

Headers
Code: [Select]
<script language="JavaScript">
<!--
<!--
var message = new Array();
message[0] = "YOUR MESSAGE HERE";
var reps = 2;
var speed = 500;
var p = message.length;
var T = "";
var C = 0;
var mC = 0;
var s = 0;
var sT = null;
if (reps < 1) reps = 1;
function doTheThing() {
T = message[mC];
A();
}
function A() {
s++;
if (s > 8) { s = 1;}
if (s == 1) { document.title = T; }
if (s == 2) { document.title = T; }
if (s == 3) { document.title = T; }
if (s == 4) { document.title = T; }
if (s == 5) { document.title = T; }
if (s == 6) { document.title = T; }
if (s == 7) { document.title = T; }
if (s == 8) { document.title = T; }
if (C < (8 * reps)) {
sT = setTimeout("A()", speed);
C++;
}
else {
C = 0;
s = 0;
mC++;
if(mC > p - 1) mC = 0;
sT = null;
doTheThing();
}
}
doTheThing();
// End -->
//-->
</script>

This is what you can edit and how:
Quote
message[0] = "YOUR MESSAGE HERE";
var reps = 2;
var speed = 500;
Red Text = You must edit this, this are the changing titles.
Yellow Text = How many messages you want to be displayed.
Purple Text = Message Number
Green Text = Amount of seconds until the title changes again.

If you want to have more different titles, just add more of these lines (don't forget to change the X to the right number!)
Code: [Select]
message[X] = "YOUR MESSAGE HERE";

9
Advertise Your Board / ~~~~~~~~~~~~~~FROM THE INSIDE~~~~~~~~~~~~~~
« on: December 29, 2008, 06:16:36 pm »
Welcome to the AD board of From the inside, a forum with thousends of cool stuff to do with your computer, like cool tricks in CMD, accesing secret google modes and more! (note: this is not hacking, it is legal, if you don't beleve me watch the forum and test it ;D)

WE NEED PERSONAL!
This is what we need:
Moderators (for the boards of course)
Programmers (for new content then and then)
AND OF COURSE much and much members!!! So sing up now, and get tons of cool stuff!

 :police: :police: :police: :police: :police: :police: :police: :police: :police: :police: :police: :police:
SO GO ON, AND SING UP NOW AT WWW.FROMTHEINSIDE.SMFFORFREE.COM!!! :crazy2: :crazy2: :crazy2: :crazy2: :crazy2: :crazy2: :crazy2: :crazy2: :crazy2: :crazy2:

10
SMF For Free Codes and Support / [CODE] Forum Enlargement [QUB1]
« on: November 14, 2008, 03:07:59 pm »
This code will give some little buttons to enlarge or make your forum smaller. I only tested it by putting it in my footers, and that worked, so i think the headers should work too. Just paste the following code in either your footers or your headers, wherever you want the buttons to appear:

Quote
<input type="radio" name="z" onclick="document.body.style.zoom=1.0;this.blur();">100%<br>
<input type="radio" name="z" onclick="document.body.style.zoom=1.5;this.blur();">150%<br>
<input type="radio" name="z" onclick="document.body.style.zoom=2.0;this.blur();">200%<br>
<input type="radio" name="z" onclick="document.body.style.zoom=5.0;this.blur();">500%<br>
<input type="radio" name="z" onclick="document.body.style.zoom=10.0;this.blur();">1000%<br><p></p>

It isn't really editable, just if you want to edit the enlargement, change the blue text (to do this you must at least know a bit of scripting).

Oh, yeah, i know this is a bit of a sudden comeback, but i was very busy programmng my own mmorpg, so i've been away for a while, but, just enjoy =D
~ Qub1

11
Forum Url: http://privategamer.smfforfree4.com
-------------------------------------------------------
THE ULTIMATE FORUM
FOR-

~ PRIVATE SERVERS
~ GAMES
~ HTML CODES
~ GAME RELEASES

AND MUCH MUCH MORE GREAT STUFF!!!
SO CHECK IT OUT!

12
General Support / Server 4 "No Input File Specified" - Topic Merge
« on: July 10, 2008, 02:25:40 pm »
My forum, www.privategamer.smfforfree4.com cant be found! when i go there, i gt a quick ''No Input file selected'', and then i get that the page cant get found! Please help!

13
General Support / Ok, how do i do the Following?
« on: April 24, 2008, 09:38:04 am »
Ok, with SMFFORFREE updating and all, i need answers to a few questions:

- How do i sing up for SMFforfree 4 or 3? Everytime i type www.smfforfree4.com i get the singup for smfforfree 2.
- Where did the WIKI gone to? I need it for my new forum!
- And, will the Challange and Competitions for the Arcade come back?

Thanks for answering!

14
Forum Url: http://qub1test.smfforfree4.com
Here again, i used some of my older codes, pasted them together and voila! Here's The Wonder Age Calculator (Strange name huh :uglystupid2: )!
You can use it to let Users do the following stuff:

  • Calculate their Age
  • Calculate how long they live
  • Calculate when their next birthday will come (On the Millisecond! ;) )
  • And finally... here's a Previeuw

So paste this all in your Footers:
Code: [Select]
<body onload="start()">
<script language="JavaScript">


<!-- Begin
function start() {
document.form1.day.value = "";
document.form1.month.value = "";
document.form1.year.value = "";
document.form1.age.value = "";
document.form1.months.value = "";
document.form1.weeks.value = "";
document.form1.answer.value = "";
document.form1.hours.value = "";
document.form1.min.value = "";
document.form1.sec.value = "";
document.form1.bday.value = "";
document.form1.milli.value = "";
}
function run() {
var ap;
dd = document.form1.day.value;
mm = document.form1.month.value;
yy = document.form1.year.value;
with(document.form1) {
ap = parseInt(ampm.selectedIndex);
hr = parseInt(hrs.value);
if(hr <= 0 && hr >= 13) {
ap = null;
alert("asdf")
   }
}
main="valid";
if ((mm < 1) || (mm > 12) || (dd < 1) || (dd > 31) || (yy < 1) ||(mm == "") || (dd == "") || (yy == ""))
main = "Invalid";
else
if (((mm == 4) || (mm == 6) || (mm == 9) || (mm == 11)) && (dd > 30))
main = "Invalid";
else
if (mm == 2) {
if (dd > 29)
main = "Invalid";
else if((dd > 28) && (!lyear(yy)))
main="Invalid";
}
else
if((yy > 9999)||(yy < 0))
main = "Invalid";
else
main = main;
if(main == "valid") {
function leapyear(a) {
if(((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0))
return true;
else
return false;
}
days = new Date();
gdate = days.getDate();
gmonth = days.getMonth();
gyear = days.getYear();
age = gyear - yy;
if((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
age = age;
}
else {
if(mm <= (gmonth)) {
age = age;
}
else {
age = age - 1;
   }
}
if(age == 0)
age = age;
document.form1.age.value=" You are " + age+ " year(s) old &";
if(mm <= (gmonth + 1))
age = age - 1;
if((mm == (gmonth + 1)) && (dd > parseInt(gdate)))
age = age + 1;
var m;
var n;
if (mm == 12) { n = 31 - dd; }
if (mm == 11) { n = 61 - dd; }   
if (mm == 10) { n = 92 - dd; } 
if (mm == 9) { n = 122 - dd; }
if (mm == 8) { n = 153 - dd; }   
if (mm == 7) { n = 184 - dd; }   
if (mm == 6) { n = 214 - dd; } 
if (mm == 5) { n = 245 - dd; }
if (mm == 4) { n = 275 - dd; }
if (mm == 3) { n = 306 - dd; }
if (mm == 2) { n = 334 - dd; if(leapyear(yy)) n = n + 1; }
if (mm == 1) { n = 365 - dd; if (leapyear(yy)) n = n + 1; }
if (gmonth == 1) m = 31;
if (gmonth == 2) { m = 59;   if (leapyear(gyear)) m = m + 1; }
if (gmonth == 3) { m = 90;   if (leapyear(gyear)) m = m + 1; }
if (gmonth == 4) { m = 120;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 5) { m = 151;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 6) { m = 181;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 7) { m = 212;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 8) { m = 243;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 9) { m = 273;  if (leapyear(gyear)) m = m + 1; }
if (gmonth == 10) { m = 304; if (leapyear(gyear)) m = m + 1; }
if (gmonth == 11) { m = 334; if (leapyear(gyear)) m = m + 1; }
if (gmonth == 12) { m = 365; if (leapyear(gyear)) m = m + 1; }
totdays = (parseInt(age) * 365);
totdays += age / 4;
totdays = parseInt(totdays) + gdate + m + n;
document.form1.answer.value = "" + totdays +" days ";
months = age * 12;
months += 12 - parseInt(mm);
months += gmonth;
document.form1.months.value = months + " Months";
if (gmonth == 1) p = 31 + gdate;
if (gmonth == 2) { p = 59 + gdate;   if (leapyear(gyear)) m = m + 1; }
if (gmonth == 3) { p = 90 + gdate;   if (leapyear(gyear)) p = p + 1; }
if (gmonth == 4) { p = 120 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 5) { p = 151 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 6) { p = 181 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 7) { p = 212 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 8) { p = 243 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 9) { p = 273 + gdate;  if (leapyear(gyear)) p = p + 1; }
if (gmonth == 10) { p = 304 + gdate; if (leapyear(gyear)) p = p + 1; }
if (gmonth == 11) { p = 334 + gdate; if (leapyear(gyear)) p = p + 1; }
if (gmonth == 12) { p = 365 + gdate; if (leapyear(gyear)) p = p + 1; }
weeks = totdays / 7;
weeks += " weeks";
weeks = parseInt(weeks);
document.form1.weeks.value = weeks + " Weeks";
var time = new Date();
ghour = time.getHours();
gmin = time.getMinutes();
gsec = time.getSeconds();
hour = ((age * 365) + n + p) * 24;
hour += (parseInt(age / 4) * 24);
if(ap == 0)
hour = hour - hr;
else {
if(ap == 1) {
hour = hour - (11 + hr)
   }
}
document.form1.hours.value = hour + " Hours";
var min;
min = (hour * 60) + gmin;
document.form1.min.value = min + " Minutes";
sec = (min * 60) + gsec;
document.form1.sec.value = sec + " Seconds";
var millisec;
var gmil;
gmil = days.getMilliseconds();
millisec = (sec * 1000) + gmil;
document.form1.milli.value = millisec + " Milliseconds";
mm = mm - 1;
var r;
if(mm == 0) r = 1;
if(mm == 1) r = 31;
if(mm == 2) { r = 59;    if (leapyear(gyear)) m = m + 1; }
if(mm == 3) { r = 90;    if (leapyear(gyear)) r = r + 1; }
if(mm == 4) { r = 120;   if (leapyear(gyear)) r = r + 1; }
if(mm == 5) { r = 151;   if (leapyear(gyear)) r = r + 1; }
if(mm == 6) { r = 181;   if (leapyear(gyear)) r = r + 1; }
if(mm == 7) { r = 212;   if (leapyear(gyear)) r = r + 1; }
if(mm == 8) { r = 243;   if (leapyear(gyear)) r = r + 1; }
if(mm == 9) { r = 273;   if (leapyear(gyear)) r = r + 1; }
if(mm == 10) { r = 304;  if (leapyear(gyear)) r = r + 1; }
if(mm == 11) { r = 334;  if (leapyear(gyear)) r = r + 1; }
if(mm == 12) { r = 365;  if (leapyear(gyear)) r = r + 1; }
mm = mm + 1;
r = parseInt(r) + parseInt(dd);
if( mm > (gmonth + 1)) {
bday = r - m - gdate;
}
else {
if(mm == (gmonth + 1) && (gdate < dd)) {
bday = (r - m - gdate);
}
else {
if((leapyear(gyear)) && ((mm > 2) && (dd < 29))) {
a = 366;
}
else {
a = 365;
}
bday = a + (r - m - gdate);
   }
}
nhour = 24-parseInt(ghour);
nmin = 60 - parseInt(gmin);
nsec = 60 - parseInt(gsec);
go();
if(((bday == 366) && (leapyear(yy))) || ((bday == 365) && (!leapyear(yy)))) {
document.form1.bday.value = "today is your birthday";
alert("Happy Birthday");
} else {
document.form1.bday.value = bday + " days " + nhour + " hours " + nmin + " minutes " + nsec + " seconds";
setTimeout("run()", 1);
}
function go() {
function lyear(a) {
if(((a % 4 == 0) && (a % 100 != 0)) || (a % 400 == 0)) return true;
else return false;
}
mm = parseInt(mm);
dd = parseInt(dd);
yy = parseInt(yy);
if ((mm < 1) || (mm > 12) || (dd < 1) || (dd > 31) || (yy < 1) ||(mm == " ") || (dd == " ") || (yy == " "))  main="Invalid";
else
if (((mm == 4) || (mm == 6) || (mm == 9) || (mm == 11)) && (dd > 30)) main = "Invalid";
else
if (mm == 2) {
if (dd > 29)
main = "Invalid";
else
if(( dd > 28) && (!lyear(yy)))
main = "Invalid";
}
else main = main;
if(main == "valid") {
var m;
if (mm == 1) n = 31;
if (mm == 2) n = 59 + 1;
if (mm == 3) n = 90 + 1;
if (mm == 4) n = 120 + 1;
if (mm == 5) n = 151 + 1;
if (mm == 6) n = 181 + 1;
if (mm == 7) n = 212 + 1;
if (mm == 8) n = 243 + 1;
if (mm == 9) n = 273 + 1;
if (mm == 10) n = 304 + 1;
if (mm == 11) n = 334 + 1;
if (mm == 12) n = 365 + 1;
if((mm == 1)||(mm == 3)||(mm == 5)||(mm == 7)||(mm == 8)||(mm == 10)||(mm == 12))
n += 31 + dd;
else if((mm == 4)||(mm == 6)||(mm == 9)||(mm == 11))
n += 31 + dd + 1;
else if(mm == 2) {
if(lyear(yy)) n += 29 + dd - 3;
else if(!lyear(yy)) n += 28 + dd - 1;
}
fours = yy / 4;
hunds = yy / 100;
fhunds = yy / 400;
var day;
day = (yy + n + fours - hunds + fhunds) % 7;
day = parseInt(day)
switch(day)
{
case 1 : document.form1.age.value +=" you are born on a Sunday"
break
case 2 : document.form1.age.value +=" you are born on a Monday"
break
case 3 : document.form1.age.value +=" you are born on a Tuesday"
break
case 4 : document.form1.age.value +=" you are born on a Wednesday"
break
case 5 : document.form1.age.value +=" you are born on a Thursday"
break
case 6 : document.form1.age.value +=" you are born on a Friday"
break
case 7 : document.form1.age.value +=" you are born on a Saturday"
break
case 0 : document.form1.age.value +=" you are born on a Saturday"
break
   }
}
else {
document.form1.age.value += main + " Date";
      }
   }
}
else {
document.form1.age.value = main + " Date";
document.form1.months.value = "";
document.form1.weeks.value = "";
document.form1.answer.value = "";
document.form1.hours.value = "";
document.form1.min.value = "";
document.form1.sec.value = "";
document.form1.bday.value = "";
document.form1.milli.value = "";
   }
}
//  End -->
</script>

<p align="center"><br>
Fill your Birth-Date in in the below fields<br>
</p>

<form name="form1">
    <p align="center">Month<input type="text" size="3"
    name="month">  Day<input type="text" size="3" name="day">
      Year<input type="text" size="6" name="year">  Hour<input
    type="text" size="6" name="hrs" value="00"> <select
    name="ampm" size="1">
        <option selected>AM</option>
        <option>PM</option>
    </select> <input type="button" name="start" value="Calculate"
    onclick="run()"> <br>
    <br>
    <input type="text" size="55" name="age"
    value="This is where your Age will appear"> <br>
    <br>
    This is how long you live: <br>
    </p>
    <div align="center"><center><table border="0">
<TBODY>        <tr>
            <td>Months :</td>
            <td><input type="text" size="30" name="months"></td>
        </tr>
        <tr>
            <td>Weeks :</td>
            <td><input type="text" size="30" name="weeks"></td>
        </tr>
        <tr>
            <td>Days :</td>
            <td><input type="text" size="30" name="answer"></td>
        </tr>
        <tr>
            <td>Hours :</td>
            <td><input type="text" size="30" name="hours"></td>
        </tr>
        <tr>
            <td>Minutes :</td>
            <td><input type="text" size="30" name="min"></td>
        </tr>
        <tr>
            <td>Seconds :</td>
            <td><input type="text" size="30" name="sec"></td>
        </tr>
        <tr>
            <td>Milliseconds :</td>
            <td><input type="text" size="30" name="milli"></td>
        </tr>
</TBODY>    </table>
    </center></div><p align="center">Your next birthday is
    over: <br>
    <input type="text" size="40" name="bday"> </p>
</form>

Oh, i figured to make it non-editable, becuse it's waaaaay to long for that.

Happy birthday (Lol, just kidding!  :2funny: )!
- Qub1

15
SMF For Free Codes and Support / [CODE] Draggable Calculator! [Qub1]
« on: March 30, 2008, 02:19:01 pm »
Forum Url: http://qub1test.smfforfree4.com
Ok, all this code does is place a Draggable calculator at your site...
Oh, and heres a note for Simply Sibyl:
I've found a solution! With your draggable smileys, you needed to upload 2 js files, but i found a solution so you don't have to do so! Just see the code...
Ok, so this is how it looks:

Previeuw (The calculator is at the bottom, and it's draggable)

Now, paste this in your headers:
Code: [Select]
<script language="JavaScript1.2">
     var ie=document.all
     var ns6=document.getElementById&&!document.all

     var dragapproved=false
     var z,x,y

     function move(e)
     {
          if (dragapproved)
          {
               z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
               z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
               return false
          }
     }

     function drags(e)
     {
          if (!ie&&!ns6)
               return
          var firedobj=ns6? e.target : event.srcElement
          var topelement=ns6? "HTML" : "BODY"

          while (firedobj.tagName!=topelement&&firedobj.className!="drag")
          {
               firedobj=ns6? firedobj.parentNode : firedobj.parentElement
          }

          if (firedobj.className=="drag")
          {
               dragapproved=true
               z=firedobj
               temp1=parseInt(z.style.left+0)
               temp2=parseInt(z.style.top+0)
               x=ns6? e.clientX: event.clientX
               y=ns6? e.clientY: event.clientY
               document.onmousemove=move
               return false
          }
     }

     document.onmousedown=drags
     document.onmouseup=new Function("dragapproved=false")
   </script>


<style type='text/css'>.drag{position:relative;cursor:crosshair}</style>

And this in your Footers:
Code: [Select]
<div id="calc" class="drag">
  <form name="calculator">
   <table border="3" cellpadding="0" bordercolor="black" bgcolor="#CCFFCC" cellspacing="1" width="150">
    <tr>
     <td>
      <input type="text" size="20" length="19" value="" name="ans" style="background:black;color:lime;">
     </td>
    </tr>
   </table>

   <table border="3" cellpadding="2" bordercolor="black" cellspacing="2" width="150" bgcolor="#CCFFCC">
    <tr>
     <td align="center">
      <input type="button" value="  7  " name="seven" onMouseDown="document.calculator.ans.value+='7'">
     </td>
     <td align="center">
      <input type="button" value="  8  " name="eight" onClick="document.calculator.ans.value+='8'">
     </td>
     <td align="center">
      <input type="button" value="  9  " name="nine" onClick="document.calculator.ans.value+='9'">
     </td>
     <td align="center">
      <input type="button" value="  /  " name="divide" onClick="document.calculator.ans.value+='/'">
     </td>
    </tr>
    <tr>
     <td align="center">
      <input type="button" value="  4  " name="four" onClick="document.calculator.ans.value+='4'">
     </td>
     <td align="center">
      <input type="button" value="  5  " name="five" onClick="document.calculator.ans.value+='5'">
     </td>
     <td align="center">
      <input type="button" value="  6  " name="six" onClick="document.calculator.ans.value+='6'">
     </td>
     <td align="center">
      <input type="button" value="  *  " name="multiply" onClick="document.calculator.ans.value+='*'">
     </td>
    </tr>
    <tr>
     <td align="center">
      <input type="button" value="  1  " name="one" onClick="document.calculator.ans.value+='1'">
     </td>
     <td align="center">
      <input type="button" value="  2  " name="two" onClick="document.calculator.ans.value+='2'">
     </td>
     <td align="center">
      <input type="button" value="  3  " name="three" onClick="document.calculator.ans.value+='3'">
     </td>
     <td align="center">
      <input type="button" value="  -  " name="subtract" onClick="document.calculator.ans.value+='-'">
     </td>
    </tr>
    <tr>
     <td align="center">
      <input type="button" value="  C  " name="clear" onClick="document.calculator.ans.value=''">
     </td>
     <td align="center">
      <input type="button" value="  0  " name="zero" onClick="document.calculator.ans.value+='0'">
     </td>
     <td align="center">
      <input type="button" value="  =  " name="equal" onClick="document.calculator.ans.value=eval(document.calculator.ans.value)">
     </td>
     <td align="center">
      <input type="button" value="  +  " name="add" onClick="document.calculator.ans.value+='+'">
     </td>
    </tr>
   </table>
  </form>
  </div>

Ok, that was it (not editable, it's a wonder! lol :P)!
- Qub1

Pages: [1] 2 3 4 5