| Author |
Message |
Choakster
Nuke Soldier


Joined: Aug 19, 2004
Posts: 17
|
Posted:
Fri Dec 24, 2004 4:08 pm |
  |
Well I didnt write this little doozy but its kinda fun and adds to the holiday spirit .. This will add snowflakes to your site that trickle down
To change how much snow falls simply edit the line
To change the color of the snow just change it from White to whatever color you want ..
| Code: |
##############################################################
## MOD Title: Snowflakes
## Ported to Nuke: Choakster
## MOD Author: Legendary GIR <administrator@legendarygir.us> ## http://www.legendarygir.us
##
## MOD Description: Snowflakes.
##
## MOD Version: 1.0.0
##
## INSTALLATION DIFFIULTY: VERY EASY
## INSTALLATION TIME: 2 Minutes ## FILES TO EDIT: /mainfile.php ## /footer.php
## (Files are in the root Nuke Directory)
##############################################################
## NOTES: Before Adding This MOD To Your Forum, You Should Back
## Up All Files Related To This MOD
##############################################################
## I didn't write this mod on my own. Basically I found the
## the javascript on a scripting website and I incorporated it
## with the dark theme of my forum.
##############################################################
## If you want the snowflakes to be white then go through this
## mod and change all the red to white.
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
mainfile.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[AFTER, ADD]------------------------------------------
#
<style>
.drop { position: absolute; width: 3; filter: flipV(), flipH(); font-size: 8; color: yellow }
</style>
<script language="javascript">
snow = true; // false-rain; true-snow
snowsym = " * " //These are the symbols for each
rainsym = " ' " //You can put images here.
howmany = 10 //How many drops/snowflakes?
/**************Do not need to change anything below***********/
if(snow){sym = snowsym; speed=1; angle=10; drops=howmany}
else{sym = rainsym; speed=10; drops=howmany; angle=6}
movex = -speed/angle; movey = speed; count = 0;
function moverain(){
for(move = 0; move < drops; move++){
xx[move]+=movex; yy[move]+=mv[move];
hmm = Math.round(Math.random()*1);
if(xx[move] < 0){xx[move] = maxx+10;}
if(yy[move] > maxy){yy[move] = 10;}
drop[move].left = xx[move]
drop[move].top = yy[move]+document.body.scrollTop;
}setTimeout('moverain()','1')}
</script>
<script language="JavaScript1.2">
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=20
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}
</script>
#
#-----[ OPEN ]------------------------------------------
#
footer.php
#
#-----[ FIND ]------------------------------------------
#
<?php
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<script language="javascript">
if (document.all){
drop = new Array(); xx = new Array(); yy = new Array(); mv = new Array()
ly = "document.all[\'"; st = "\'].style"
for(make = 0; make < drops; make++){
document.write('<div id="drop'+make+'" class=drop>'+sym+'</div>');
drop[make] = eval(ly+'drop'+make+st);
maxx = document.body.clientWidth-40
maxy = document.body.clientHeight-40
xx[make] = Math.random()*maxx;
yy[make] = -100-Math.random()*maxy;
drop[make].left = xx[make]
drop[make].top = yy[make]
mv[make] = (Math.random()*5)+speed/4;
drop[make].fontSize = (Math.random()*10)+20;
if(snow){col = 'White'}else{col = 'White'}
drop[make].color = col;
}
window.onload=moverain
}
</script>
#
#-----[SAVE/CLOSE ALL FILES ]------------------------------------------
#
|
You can change the color of the flakes by changing all the instances of the word white to red , green , blue , yellow etc ...
Good luck
Happy Holidays |
|
|
   |
 |
Leviathan
Nuke Cadet


Joined: Jan 05, 2005
Posts: 2
|
Posted:
Sat Dec 16, 2006 3:11 pm |
  |
Thank you,
it's working great, but can you make some modifications to work in Mozilla too?
Thanks again... |
|
|
   |
 |
Fireboar
Corporal


Joined: Dec 01, 2006
Posts: 64
|
Posted:
Sun Dec 17, 2006 11:23 am |
  |
This one works on Mozilla. It has similar effects except (IMO) it looks cooler, has more functionality and works on all browsers.
http://www.fantasy-pc.com/snowflakesmod.txt
Hope you find that useful! |
_________________ http://www.fantasy-pc.com/ - PHP-Nuke website with a growing community where you can talk about anything.
Want a version of PHP-Nuke with all the bells and whistles removed? PHP-Nuke Lite is for you! |
|
    |
 |
sgar
Nuke Cadet


Joined: Dec 18, 2006
Posts: 3
|
Posted:
Mon Dec 18, 2006 2:46 am |
  |
| Fireboar wrote: |
This one works on Mozilla. It has similar effects except (IMO) it looks cooler, has more functionality and works on all browsers.
http://www.fantasy-pc.com/snowflakesmod.txt
Hope you find that useful! |
Just what i have been looking for the last few days!!! Just one question though, any ideas why my shoutbox block its now empty?
Thanks in advance
PS: First post here, hi everybody |
|
|
   |
 |
wizzy
Nuke Soldier


Joined: Apr 08, 2006
Posts: 20
|
Posted:
Mon Dec 18, 2006 3:00 am |
  |
Mine too  |
|
|
   |
 |
sgar
Nuke Cadet


Joined: Dec 18, 2006
Posts: 3
|
Posted:
Mon Dec 18, 2006 3:05 am |
  |
|
   |
 |
wizzy
Nuke Soldier


Joined: Apr 08, 2006
Posts: 20
|
Posted:
Mon Dec 18, 2006 3:16 am |
  |
I am sure that is a java script issue but I don't know how to fix it |
|
|
   |
 |
Fireboar
Corporal


Joined: Dec 01, 2006
Posts: 64
|
Posted:
Mon Dec 18, 2006 8:13 am |
  |
Fantasy PC have had that issue for ages. But you guys have had it triggered by this javascript mod? Hmm... I'll look into it. Thanks for reporting it.
Edit:
Okay, guys, I've solved the issue. I've updated the module instructions, but here is the "patch" for Snowflakes 1.0.0 to Snowflakes 1.0.1 (one has to do the thing properly ):
| Code: |
##############################################################
## Patch Title: Snowflakes
## Patch Author: Fireboar
## Original Mod By: Fireboar
## http://www.fantasy-pc.com/
##
## MOD Description: Snowflakes.
##
## Patch Version: 1.0.0 - 1.0.1
##
## INSTALLATION DIFFIULTY: VERY EASY
## INSTALLATION TIME: 30 Seconds
## FILES TO EDIT: footer.php
## shoutbox.js
## (Files are in the root Nuke Directory)
##############################################################
## NOTES: Before Adding This MOD To Your Forum, You Should Back
## Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
footer.php
#
#-----[ FIND ]------------------------------------------
#
window.onload=initsnow
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Onload handled in shoutbox.js
// window.onload=initsnow
#
#-----[ OPEN ]------------------------------------------
#
shoutbox.js
#
#-----[ FIND ]------------------------------------------
#
function allonloads(){
SBpopulate();
#
#-----[ AFTER, ADD ]------------------------------------------
#
initsnow();
#
#-----[SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EOM |
That works a treat. It's a known issue that the shoutbox is not compatible with any onload javascript commands, so they made a function to handle that.
Thanks for pointing it out . |
_________________ http://www.fantasy-pc.com/ - PHP-Nuke website with a growing community where you can talk about anything.
Want a version of PHP-Nuke with all the bells and whistles removed? PHP-Nuke Lite is for you!
Last edited by Fireboar on Mon Dec 18, 2006 8:38 am; edited 1 time in total |
|
    |
 |
Evaders99
Site Admin


Joined: Aug 17, 2003
Posts: 12397
|
Posted:
Mon Dec 18, 2006 8:13 am |
  |
|
     |
 |
Fireboar
Corporal


Joined: Dec 01, 2006
Posts: 64
|
Posted:
Mon Dec 18, 2006 8:40 am |
  |
Heh... looks like you beat me to it before I had chance to edit . Javascript.php looked kinda confusing, so I'm not really inclined to try making it work with that file. The patch will do the job, so I'm not really fussed. |
_________________ http://www.fantasy-pc.com/ - PHP-Nuke website with a growing community where you can talk about anything.
Want a version of PHP-Nuke with all the bells and whistles removed? PHP-Nuke Lite is for you! |
|
    |
 |
sgar
Nuke Cadet


Joined: Dec 18, 2006
Posts: 3
|
Posted:
Mon Dec 18, 2006 9:10 am |
  |
@Fireboar Many thanks, that did indeed do the job!!!!
Happy Xmas all  |
|
|
   |
 |
wizzy
Nuke Soldier


Joined: Apr 08, 2006
Posts: 20
|
Posted:
Tue Dec 19, 2006 12:37 am |
  |
I tried the fix. My shoutbox works. The only problem is that the shoutbox is appeared only on the main page of the site in center not in right or left column. So snowflakes are not working on other pages |
|
|
   |
 |
Fireboar
Corporal


Joined: Dec 01, 2006
Posts: 64
|
Posted:
Tue Dec 19, 2006 8:37 am |
  |
Hmm... that's a tricky situation wizzy. How about this?
1) Open up modules/Shout_Box/index.php
2) Find:
| Code: |
| $module_name = basename(dirname(__FILE__)); |
3) Before, add:
4) Save and close, then open up footer.php
5) Find:
| Code: |
| // window.onload=initsnow |
6) Replace with:
| Code: |
| <?php if (!$shoutbox_on) echo "window.onload=initsnow"; ?> |
Edit: This has to be done AFTER the 1.0.1 patch. |
_________________ http://www.fantasy-pc.com/ - PHP-Nuke website with a growing community where you can talk about anything.
Want a version of PHP-Nuke with all the bells and whistles removed? PHP-Nuke Lite is for you! |
|
    |
 |
durango
Corporal


Joined: Apr 13, 2003
Posts: 64
|
Posted:
Thu Dec 21, 2006 7:17 am |
  |
Hi... can we have final instructions from A-Z in one post? I lost track of what has to be done... do we do what choakster suggested?? |
|
|
   |
 |
Fireboar
Corporal


Joined: Dec 01, 2006
Posts: 64
|
Posted:
Thu Dec 21, 2006 8:08 am |
  |
The final instructions for 1.0.1 (that's the up-to-date one) are to be found in the link to the mod instructions I posted: http://www.fantasy-pc.com/snowflakesmod.txt
If you don't have your Shout_Box module as a left block, also follow the instructions to fix Wizzy's problem. But almost everyone does have Shout_Box on the left.
I've been updating the final instructions whenever a problem/fix has been found. Just follow what's in the link and you should be fine. My module is an alternative, not a modification of Choakster's suggestion. (Yeah, sorry for invading and overtaking the thread like that...) |
_________________ http://www.fantasy-pc.com/ - PHP-Nuke website with a growing community where you can talk about anything.
Want a version of PHP-Nuke with all the bells and whistles removed? PHP-Nuke Lite is for you! |
|
    |
 |
|
|