You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 48 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Adding Snowflakes to your site [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Choakster
Nuke Soldier
Nuke Soldier


Joined: Aug 19, 2004
Posts: 17


PostPosted: Fri Dec 24, 2004 4:08 pm Reply with quoteBack to top

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
Find all posts by ChoaksterView user's profileSend private message
Leviathan
Nuke Cadet
Nuke Cadet


Joined: Jan 05, 2005
Posts: 2


PostPosted: Sat Dec 16, 2006 3:11 pm Reply with quoteBack to top

Thank you,
it's working great, but can you make some modifications to work in Mozilla too?


Thanks again...
Find all posts by LeviathanView user's profileSend private message
Fireboar
Corporal
Corporal


Joined: Dec 01, 2006
Posts: 64


PostPosted: Sun Dec 17, 2006 11:23 am Reply with quoteBack to top

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!
Find all posts by FireboarView user's profileSend private messageVisit poster's website
sgar
Nuke Cadet
Nuke Cadet


Joined: Dec 18, 2006
Posts: 3


PostPosted: Mon Dec 18, 2006 2:46 am Reply with quoteBack to top

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
Find all posts by sgarView user's profileSend private message
wizzy
Nuke Soldier
Nuke Soldier


Joined: Apr 08, 2006
Posts: 20


PostPosted: Mon Dec 18, 2006 3:00 am Reply with quoteBack to top

Mine too Sad
Find all posts by wizzyView user's profileSend private message
sgar
Nuke Cadet
Nuke Cadet


Joined: Dec 18, 2006
Posts: 3


PostPosted: Mon Dec 18, 2006 3:05 am Reply with quoteBack to top

looks like even http://www.fantasy-pc.com/ has same prob Sad
Find all posts by sgarView user's profileSend private message
wizzy
Nuke Soldier
Nuke Soldier


Joined: Apr 08, 2006
Posts: 20


PostPosted: Mon Dec 18, 2006 3:16 am Reply with quoteBack to top

I am sure that is a java script issue but I don't know how to fix it
Find all posts by wizzyView user's profileSend private message
Fireboar
Corporal
Corporal


Joined: Dec 01, 2006
Posts: 64


PostPosted: Mon Dec 18, 2006 8:13 am Reply with quoteBack to top

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 Wink):

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 Wink.

_________________
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
Find all posts by FireboarView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12397


PostPosted: Mon Dec 18, 2006 8:13 am Reply with quoteBack to top

You probably don't want to put the Javascript code in mainfile.php or footer.php

Better to put it in includes/javascript.php

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Fireboar
Corporal
Corporal


Joined: Dec 01, 2006
Posts: 64


PostPosted: Mon Dec 18, 2006 8:40 am Reply with quoteBack to top

Heh... looks like you beat me to it before I had chance to edit Smile. 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!
Find all posts by FireboarView user's profileSend private messageVisit poster's website
sgar
Nuke Cadet
Nuke Cadet


Joined: Dec 18, 2006
Posts: 3


PostPosted: Mon Dec 18, 2006 9:10 am Reply with quoteBack to top

@Fireboar Many thanks, that did indeed do the job!!!!

Happy Xmas all Very Happy
Find all posts by sgarView user's profileSend private message
wizzy
Nuke Soldier
Nuke Soldier


Joined: Apr 08, 2006
Posts: 20


PostPosted: Tue Dec 19, 2006 12:37 am Reply with quoteBack to top

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
Find all posts by wizzyView user's profileSend private message
Fireboar
Corporal
Corporal


Joined: Dec 01, 2006
Posts: 64


PostPosted: Tue Dec 19, 2006 8:37 am Reply with quoteBack to top

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:
Code:
$shoutbox_on = 1;

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!
Find all posts by FireboarView user's profileSend private messageVisit poster's website
durango
Corporal
Corporal


Joined: Apr 13, 2003
Posts: 64


PostPosted: Thu Dec 21, 2006 7:17 am Reply with quoteBack to top

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??
Find all posts by durangoView user's profileSend private message
Fireboar
Corporal
Corporal


Joined: Dec 01, 2006
Posts: 64


PostPosted: Thu Dec 21, 2006 8:08 am Reply with quoteBack to top

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!
Find all posts by FireboarView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.563 Seconds - 195 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::