vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Snow for Christmas (https://vborg.vbsupport.ru/showthread.php?t=132475)

Ev!L ErN!E 12-05-2008 11:32 PM

Quote:

Originally Posted by angelpie (Post 1675922)
hmmm not sure if i am doing this right? i cant get it to work! maybe im putting it in the wrong area in the ftp? i know its root its just been so long since i edited! the root is your public html area right? lol probably not

Your forums 'root' is the main folder that contains your forum files (ie the folder you installed your vB into)... so in your ftp look for the forum folder, or whatever the folders name is that you installed vB into, click on it and place the .js file in that folder and then do the edit in your stylemanger as explained above.

Hope that helps...

As for the problem with Firefox I do not know... I only use IE 7, sorry.

exel 12-07-2008 05:33 PM

Awesome :)

princeedward 12-07-2008 06:27 PM

thanks... ;)

TheLastSuperman 12-07-2008 08:58 PM

LOL, I see DD is everywhere :D

Anyways same idea, another thread ;)

https://vborg.vbsupport.ru/showpost....1&postcount=28

S-MAN

Trickster303 12-07-2008 11:06 PM

Quote:

Originally Posted by Trickster303 (Post 1379454)
Works just fine for me! Thanks

Wanted to make more snow, and made changes as such in the java script:

var num = 100; //Number of flakes
var timer = 30; //setTimeout speed. Varies on different comps

But nothing changed. Any suggestions as to get more flakes? Size is fine.
Thanks

Time to start the Xmas theme skin up again, and I have this mod on the skin. I asked last xmas if anyone had successfully increased the number of flakes as per above, and I see there have not been any responses, so will check again. Has anyone had any luck? If so how, as nothing changes by adjusting like I said above.
I don't want .gif images falling down the screen, I like this mod.
Appreciated.
Thanks

TheLastSuperman 12-07-2008 11:16 PM

Quote:

Originally Posted by Trickster303 (Post 1680586)
Time to start the Xmas theme skin up again, and I have this mod on the skin. I asked last xmas if anyone had successfully increased the number of flakes as per above, and I see there have not been any responses, so will check again. Has anyone had any luck? If so how, as nothing changes by adjusting like I said above.
I don't want .gif images falling down the screen, I like this mod.
Appreciated.
Thanks

In the snow.js file, find:

Code:

//Configure here.

var num = 40;  //Number of flakes
var timer = 30; //setTimeout speed. Varies on different comps

//End.

And change to suit your needs, just remember it may look better w/ more but some members may not like toooo much ;).

That SHOULD work.... not sure why not?

S-MAN

Edit: Here's a newer version of the script:

Code:

//Snow - http://www.btinternet.com/~kurt.grigg/javascript

if  ((document.getElementById) &&
window.addEventListener || window.attachEvent){

(function(){

//Configure here.

var num = 30;  //Number of flakes
var timer = 30; //setTimeout speed. Varies on different comps
var enableinNS6 = 1 //Enable script in NS6/Mozilla? Snow animation could be slow in those browsers. (1=yes, 0=no).

//End.

var y = [];
var x = [];
var fall = [];
var theFlakes = [];
var sfs = [];
var step = [];
var currStep = [];
var h,w,r;
var d = document;
var pix = "px";
var domWw = (typeof window.innerWidth == "number");
var domSy = (typeof window.pageYOffset == "number");
var idx = d.getElementsByTagName('div').length;

if (d.documentElement.style &&
typeof d.documentElement.style.MozOpacity == "string")
num = 12;

for (i = 0; i < num; i++){
sfs[i] = Math.round(1 + Math.random() * 1);

document.write('<div id="flake'+(idx+i)+'" style="position:absolute;top:0px;left:0px;width:'
+sfs[i]+'px;height:'+sfs[i]+'px;background-color:#ffffff;font-size:'+sfs[i]+'px"><\/div>');

currStep[i] = 0;
fall[i] = (sfs[i] == 1)?
Math.round(2 + Math.random() * 2): Math.round(3 + Math.random() * 2);
step[i] = (sfs[i] == 1)?
0.05 + Math.random() * 0.1 : 0.05 + Math.random() * 0.05 ;
}


if (domWw) r = window;
else{
  if (d.documentElement &&
  typeof d.documentElement.clientWidth == "number" &&
  d.documentElement.clientWidth != 0)
  r = d.documentElement;
 else{
  if (d.body &&
  typeof d.body.clientWidth == "number")
  r = d.body;
 }
}


function winsize(){
var oh,sy,ow,sx,rh,rw;
if (domWw){
  if (d.documentElement && d.defaultView &&
  typeof d.defaultView.scrollMaxY == "number"){
  oh = d.documentElement.offsetHeight;
  sy = d.defaultView.scrollMaxY;
  ow = d.documentElement.offsetWidth;
  sx = d.defaultView.scrollMaxX;
  rh = oh-sy;
  rw = ow-sx;
 }
 else{
  rh = r.innerHeight;
  rw = r.innerWidth;
 }
h = rh - 2; 
w = rw - 2;
}
else{
h = r.clientHeight - 2;
w = r.clientWidth - 2;
}
}


function scrl(yx){
var y,x;
if (domSy){
 y = r.pageYOffset;
 x = r.pageXOffset;
 }
else{
 y = r.scrollTop;
 x = r.scrollLeft;
 }
return (yx == 0)?y:x;
}


function snow(){
var dy,dx;

for (i = 0; i < num; i++){
 dy = fall[i];
 dx = fall[i] * Math.cos(currStep[i]);

 y[i]+=dy;
 x[i]+=dx;

 if (x[i] >= w || y[i] >= h){
  y[i] = -10;
  x[i] = Math.round(Math.random() * w);
  fall[i] = (sfs[i] == 1)?
  Math.round(2 + Math.random() * 2): Math.round(3 + Math.random() * 2);
  step[i] = (sfs[i] == 1)?
  0.05 + Math.random() * 0.1 : 0.05 + Math.random() * 0.05 ;
 }
 
 theFlakes[i].top = y[i] + scrl(0) + pix;
 theFlakes[i].left = x[i] + scrl(1) + pix;

 currStep[i]+=step[i];
}
setTimeout(snow,timer);
}


function init(){
winsize();
for (i = 0; i < num; i++){
 theFlakes[i] = document.getElementById("flake"+(idx+i)).style;
 y[i] = Math.round(Math.random()*h);
 x[i] = Math.round(Math.random()*w);
}
snow();
}


if (window.addEventListener){
 window.addEventListener("resize",winsize,false);
 window.addEventListener("load",init,false);

else if (window.attachEvent){
 window.attachEvent("onresize",winsize);
 window.attachEvent("onload",init);
}

})();
}//End.

You can copy then paste over the contents of your snow.js and try it then. Perhaps it's just an issue w/ you needing to clear your cookies/cache etc after you change and re-upload the file. Try that and post back however changing the variables should work!

kylek 12-09-2008 03:32 AM

Works fine with 3.8.0 Beta 4!

Stryker412 12-10-2008 02:55 PM

Same issue last year, on FF there are no where near as many flakes as IE.

gopherhockey 12-15-2008 06:49 PM

no go for me and IE7. Its complaining about r.clientheight being null or not defined.

Googled this and found others with the same issue but no resolution.

Collectors 12-17-2008 05:01 PM

This mod didn't work for me (vB 3.7.4, FireFox 3.0.5 and Explorer 7) but this one does: http://www.dynamicdrive.com/dynamici...ownoimages.htm

Isn't that the same mod?


All times are GMT. The time now is 07:53 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01650 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete