PDA

View Full Version : Forum Display Enhancements - Advanced Snowstorm Integration for Christmas


doberlec
11-29-2006, 10:00 PM
Please take some time and read this feature list before you go "Oh no, another of those pesky snowflake Mods!".

Features:
- The snow is optionally piling up on the bottom of the screen (customize the script to your liking)
- The script is lightweight and fast
- The script works on all current browsers and uses PNG images incl. GIF fallback
- Can be turned off by your users via quicklink or in the UserCP
- User can change the direction of the blowing wind

HackDetails:
Difficulty: easy
Templates to edit: 2
Approx. Time: 5-8 Minutes
Compatibility: All vB versions

As we all know, those nice scripts come at a price, and that is performance at the client side! I didn't want to pester my users with a CPU intensive script for the next 30 days and not offering a solution to switch it off in the UserCP (or temporarily). So with this hack everyone can decide for him/herself is he/she wants those nifty flakes flying around while reading the forum :)

Allright let's move to the hack itself:

First of all, I have to give full kudos to Scott Schiller who came up with the original Javascript for this nifty snowing effect. Secondly it is VERY easy to incorporate in your forum if you follow these 10 steps to success:

1) Get the latest version of the script from Scott Schiller's Homepage (http://www.schillmania.com/projects/snowstorm/)
2) Upload the script as well as all images included
3) AdminCP -> User Profile Fields -> Add New User Profile Field
4) Choose "Single Selection Radio Buttons"
5) Fill in all required fields and insert two values in the Options Box: (seperated with a return)
YES
NO
6) Set "Default" to YES
7) Hit "Save" and memorize the name of your field, in my case it's "field8".
8) Open up the Template "headinclude" and add at the bottom:


<if condition="$bbuserinfo['field8']=='YES'">
<script type="text/javascript" src="[path to your script]/script/snowstorm.js"></script>
</if>

Notice that I included the name of my field (field8) in the first line!

9) Hit "Save" and open up the template "navbar" and look for this code:
<if condition="$show['member']">

<td class="alt2" valign="top" nowrap="nowrap">
<div class="smallfont">
below add:


<if condition="$bbuserinfo['field8']=='YES'">
<a href="javascript:snowStorm.randomizeWind()">Change Wind</a>&nbsp;&nbsp;<a href="javascript:snowStorm.stop()">Stop snowing</a><br /><br />
</if>

Please note again that I included the name of my field (field8) in the first line!

10) Hit "Save" and you're ready to go!


Further thoughts:

This little hack adds the two control links directly above the login-details of your users. But it can of course be implemented where you like, you can also add graphical buttons to it. Furthermore you can use phrases to make all this multilingual, a step I took because my forums are multilingual.

Troubleshooting:

Q: It doesn't work?!
A: Be aware that this hack USES a script, which you have to download here (http://www.schillmania.com/projects/snowstorm/)!

Q: Argh, I don't see any snow flakes, but my CPU get's mangled
A: That's because the script doesn't find the images for the snowflakes. Open up the script (snowstorm.js) and set the "imagePath" to the folder where your snowflakes are in. You can even hardcode an absolute link there is everything fails.

Q: My switch in the UserCP doesn't work!
A: Make sure that you filled in the exact name of your field in the two locations which are specified in the steps above.

Q: The snow falls too slow or the flakes are too small
A: Open up the script and modify it to your liking, it's a great piece of code and well documented :)

Q: Is the snow only visible for registered users?
A: Yes, that's on perpose. Guests can't store any infos on the forum, therefore they can't switch it off if they don't like it.

Q: Oh my god it still doesn't snow... and it's mid December already!
A: Welcome to the age of global warming! Switch to a Hybrid Car, and walk more often. If everybody does that, we should get real snow again in a couple of decades :D

Shouzen
11-30-2006, 07:40 PM
I tied but it doesn't work.

doberlec
11-30-2006, 07:46 PM
Did you substitute the fieldname I was using in the hack-example with the name of the field you made on your forum? Did you check if the script is able to find the images on your server? Does the script get loaded? (You should see that in an increase of the processing power of your processor in the taskmanager in Windows).

Shouzen
11-30-2006, 07:49 PM
..Do you have msn?

Kirk Y
11-30-2006, 07:51 PM
Is this 3.5.x compatible?

SeQual
11-30-2006, 07:53 PM
HackDetails:
Difficulty: easy
Templates to edit: 2
Approx. Time: 5-8 Minutes
Compatibility: All vB versions

PixelFx
11-30-2006, 07:54 PM
nice .. i'll try this out later

Talisman
11-30-2006, 08:03 PM
It's very cute. Thank you, doberlec.

doberlec
11-30-2006, 08:15 PM
..Do you have msn?

I`m sorry but I`m behind quite a good firewall so no MSN. But here is enough space to elaborate on your problem, feel free to do so. I'll try to be as helpfull as possible :)

projectego
11-30-2006, 09:16 PM
Nice mod... I might check this our nearer to Christmas... ;)

JamieLee2k
11-30-2006, 11:42 PM
Not working, I have uploaded all the files into the root Dir and in the forum folder and it's still not working, can you give me the path the files should be in please?

Shazz
11-30-2006, 11:44 PM
So far people that have tried 0-2?

sezmar
12-01-2006, 12:54 AM
Hey nice mod but you forgot to attach the file.

I attached

Shazz
12-01-2006, 01:00 AM
Hey nice mod but you forgot to attach the file.

I attached

Lol, maybe thats why?
* Shazz waits for someone to confim it works

daklay
12-01-2006, 01:16 AM
Ah, I see the problem.

Instead of Putting it at the bottom of headerinclude, just put it at the bottom of header

JD45
12-01-2006, 03:42 AM
Ok, I got it working and here's how:

You need to upload the contents of the attached file (image and script) to your forums root directory.

Second modify header not headinclude like a previous poster had mentioned.

Here's how my header template code looks like:

<if condition="$bbuserinfo['field5']==YES">
<script type="text/javascript" src=" /forum/script/snowstorm.js"></script>
</if>

You can see a live demo at:

http://www.justpressplay.net/forum/

Edit: well, since it's a user option you won't be able to see it unless you register.

Jeordie015
12-01-2006, 04:02 AM
var snowCollect doesn't seem to work. I have it off, but the snow still collects at the bottom.

yoyoyoyo
12-01-2006, 04:18 AM
The code posted above is incorrect. Here is the proper code:

put this at the bottom of the header template:
<if condition="$bbuserinfo[field8] !='YES'">
<script type="text/javascript" src=" /forum/script/snowstorm.js"></script>
</if>

In your navbar template find:
<if condition="$show['member']">

<td class="alt2" valign="top" nowrap="nowrap">
<div class="smallfont">

add below:
<if condition="$bbuserinfo[field8] !='YES'">
<a href="javascript:snowStorm.randomizeWind()">Change Wind</a>&nbsp;&nbsp;<a href="javascript:snowStorm.stop()">Stop snowing</a><br /><br />
</if>

naturally substitute your proper profile field ID numbers as needed.

WildSharky
12-01-2006, 06:48 AM
It does not seem to trun on and off tho and yes i have the right field its 6
it just stays on all the time..
and anyways to make a to start snowing with the stop to?

<if condition="$bbuserinfo[field6] !='YES'">
<a href="javascript:snowStorm.randomizeWind()">Change Wind</a>&nbsp;&nbsp;<a href="javascript:snowStorm.stop()">Stop snowing</a><br /><br />
</if>

doberlec
12-01-2006, 07:04 AM
The code posted above is incorrect. Here is the proper code:
put this at the bottom of the header template:
<if condition="$bbuserinfo[field8] !='YES'">
<script type="text/javascript" src=" /forum/script/snowstorm.js"></script>
</if>


Dude, $bbuserinfo[field8] !='YES' doesn't make any sense. Why should the Javascript be included when the Users have set the Snow-Mode to NO?! Please get your knowledge on operators in php up to date.

@all the others: Please read all the text I posted VERY thoroughly! I didn't include the javascript in my hack because it is NOT my work. It seems that most people didn't even bother to read the first step in my list :( And also the second step, which even mentions that there are files to upload!

If you follow it to the letter it works flawlessly, either in headinclude or an the end of the header template.

WildSharky
12-01-2006, 07:19 AM
Ok i got it when you make the fleid make sure the yes and no are all caps like this..

YES
NO

Like in doberlec (https://vborg.vbsupport.ru/member.php?u=53349) post on the top...

As to doberlec (https://vborg.vbsupport.ru/member.php?u=53349) man if i wanted to learn i wouldnt need your hack so come on now you said you would support this hack do so or dont say you will.. were not all masters of php.. And thanks for the hack..

doberlec
12-01-2006, 07:36 AM
As to doberlec (https://vborg.vbsupport.ru/member.php?u=53349) man if i wanted to learn i wouldnt need your hack so come on now you said you would support this hack do so or dont say you will.. were not all masters of php.. And thanks for the hack..

Don't get me wrong: I do support this hack, as you can see I post my comments here and I also updated my hack description to incorporate the suggestions here. And I also did give the people here exact instructions on how to get this thing going. I even added a short Q&A for debugging. As for the "master of php", I don't consider myself as a master but I do have basic knowledge of programming. Operators (http://www.tizag.com/phpT/operators.php) are not only used in php but in every script/programming language in existance. Copy & pasting hacks into your forum is one thing but you should also know what the piece of code is doing, or otherwise you could damage your forum very fast.

WildSharky
12-01-2006, 07:41 AM
but that is why we backup stuff most dont know alot about it just like i didnt know that if you use Yes and No it wouldnt work but i know some php but i dont want to learn all that just to added this to my site..

And yes i see you added all that but even i got that part wrong so make it clearer please to make the yes and no all caps or change your codes yes and no to what they want to use..

and again nice hack thanks..

yoyoyoyo
12-01-2006, 10:16 AM
Dude, $bbuserinfo[field8] !='YES' doesn't make any sense. Why should the Javascript be included when the Users have set the Snow-Mode to NO?!
whoops- sorry- that's what I get for posting late at night... the correct code is this:

put this at the bottom of the header template:
<if condition="$bbuserinfo[field8]=='YES'">
<script type="text/javascript" src=" /forum/script/snowstorm.js"></script>
</if>In your navbar template find:
<if condition="$show['member']">

<td class="alt2" valign="top" nowrap="nowrap">
<div class="smallfont">add below:
<if condition="$bbuserinfo[field8]=='YES'">
<a href="javascript:snowStorm.randomizeWind()">Change Wind</a>&nbsp;&nbsp;<a href="javascript:snowStorm.stop()">Stop snowing</a><br /><br />
</if>naturally substitute your proper profile field ID numbers as needed.

Julie
12-01-2006, 02:01 PM
Thanks for this cute script! :)

Jeordie015
12-01-2006, 09:16 PM
Is anyone else having problems with the snow collecting at the bottom of the screen? I don't want it to build up. I have it set to 0 in the script, but it still does it.

SMC21
12-03-2006, 08:11 PM
Works famously for me. Remember to make sure the image path in the Script file is correct, that's what caused mine not to work at first. I had to change it from relative to absolute

redlabour
12-06-2006, 01:08 PM
Best Snow Hack ever and ever !!! :)

But can somebody edit the Code or give me a hint so that Guest can see it too as Default (Sure i understand why they can?t deactivate in it Profile but this is no reason that Guest cant see it as Default turned on! :D ) ?

Surviver
12-09-2006, 11:19 AM
Best Snow Hack ever and ever !!! :)

But can somebody edit the Code or give me a hint so that Guest can see it too as Default (Sure i understand why they can?t deactivate in it Profile but this is no reason that Guest cant see it as Default turned on! :D ) ?



<if condition="$bbuserinfo['field8']=='YES' OR !$show['member']">
<script type="text/javascript" src="[path to your script]/script/snowstorm.js"></script>
</if>#
#
Try this ;)

dobbs
12-09-2006, 06:12 PM
After 30 minutes of following the directions here is what i had to do to make it work



change this code:
<if condition="$bbuserinfo['field8']=='YES'">
<script type="text/javascript" src="[path to your script]/script/snowstorm.js"></script>
</if>

to this code:
<if condition="$bbuserinfo['field8']=='YES'">
<script type="text/javascript" src="/forum/script/snowstorm.js"></script>
</if>

and in the script change my path from:

var imagePath = 'image/snow/'; // relative path to snow images
to this:

var imagePath = '/image/snow/'; // relative path to snow images

wrang
12-10-2006, 07:52 AM
Hope for some help
I haved upload the file in the forum direktory,
The snow in images/snow folder
put the text in header template
<if condition="$bbuserinfo['field32']=='YES'">
<script type="text/javascript"
src="/forumet/snowstorm.js"></script>
</if>
Make a new profilefileld called 32

but i cant it work.

My site is in this adress
www.saltvattensguiden.se/forumet

Best regards from Sweden and im so happy that fugledstad came up into the space

sam anders
12-12-2006, 06:52 PM
thanks installed and works great :)

rburns
12-19-2006, 01:00 AM
Tried it out, found like most snow in British places it brought the site almost to a standstill.

Server load increased too much to make it worthwhile, trouble with JS sometimes :(

So brought out the snowplough and cleared it all up.

Ah well, good mod anyway.

nervous
12-20-2006, 02:36 PM
sorry but not working!!!

vectorfc
12-20-2006, 08:02 PM
This does work for me, but only in the header. Matters not whether the
<if condition="$bbuserinfo['field5']=='YES'">
<script type="text/javascript" src="/script/snowstorm.js"></script>
</if>

code is placed in the header template or the headinclude template, the snow resolutely refuses to fall past the header. Although it does fall, certainly.

Any ideas? :)

Edit: Ooh, wait! I just watched it go past the header! It seems that the snow is mysteriously dying out after a few seconds and vanishing away, not to be repeated. How strange. It works fine locally, but won't keep snowing on the server. Also, the snow isn't white, it's sort of outlined in white, and the middle of each flake takes on the colour of the skin that's being snowed on. Uhm. Again, any ideas? Heh.

GruntHalo
12-22-2006, 01:42 PM
Great mod but it seems to dratically slow down my pc.

thenotch
12-22-2006, 02:35 PM
I could never get it to work. I tried every option that was presented here and no snow.

Glad it worked for some, I finally gave up...

Chet T16
12-22-2006, 08:25 PM
Its working for me here but i needed to go into my user cp and hit save under the yes/no option before it did.

It slowing the PC down something terrible so i probably won't keep it

thanasis1
12-26-2008, 11:20 AM
still not working.. i tried every combination of path