MyBB Community Forums

Full Version: Snowflocks?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
laie_techie Wrote:
ssjtoo Wrote:So I added and activated the plugin, enter the info for the image, but when i click add i get the following error...

Quote:MySQL error: 1264
Out of range value adjusted for column 'id' at row 1
Query: INSERT INTO mybb_floating_images (id, name, prefix, url, number, height, time) VALUES ('', 'SnowFlakes', 'sf', 'images/snow.gif', '15', '1000', '60')

What am i doing wrong. >.<

OK, looks like my MySQL server is set up slightly differently than yours. Change that empty string into either null or 0 and tell us if that fixes the error.

This is gona seem like a stupid question, but change it in which file i which folder.? Sad
laie_techie Wrote:OK, here are all the new controls:
snow_display: how many flakes to show (0 to disable, 25 or less recommended)
snow_url: the URL for the image to float down
snow_prefix: the prefix to use for each DIV
snow_time: how long to display snow, in seconds (0 = forever)

I really can't get this to work . I don't know where i've gone wrong at all?

Quote:Name = Snowing
Prefix = snow_
Image URL /htdocs/images/snow.gif ( htdocs) is the root where the board is. Also tried images/snow.gif
Number = 15
Height =1500
Time to Live = 60

Any help or advice please i want snow on my site LOL .


Thanks.
Kodaks Wrote:Heres a good one:
http://dynamicdrive.com/dynamicindex3/snow.htm

Ok what am i doing wrong on that link as i've tried to do what it says but still no good?


I've pasted the code in Admin cp > Theme manager > Edit theme>Body (Customized in this style)

Quote:script type="text/javascript">

/******************************************
* Snow Effect Script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use
******************************************/

//Configure below to change URL path to the snow image
var snowsrc= htdocs/images/simplered//snow.gif
// Configure below to change number of snow to render
var no = 100;
// Configure whether snow should disappear after x seconds (0=never):
var hidesnowtime = 10;
// Configure how much snow should drop down before fading ("windowheight" or "pageheight")
var snowdistance = "pageheight";

///////////Stop Config//////////////////////////////////

var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 600;

if (ns6up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = iecompattest().clientWidth;
doc_height = iecompattest().clientHeight;
}

dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
snowsrc=(snowsrc.indexOf("red-kopites.com")!=-1)? "htdocs/images/simplered//snow.gif" : snowsrc
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ie4up||ns6up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://dynamicdrive.com\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");
}
}
}

function snowIE_NS6() { // IE and NS6 main animation function
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
}
dx[i] += stx[i];
document.getElementById("dot"+i).style.top=yp[i]+"px";
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}

function hidesnow(){
if (window.snowtimer) clearTimeout(snowtimer)
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"
}


if (ie4up||ns6up){
snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}

</script>

I've uploaded the image but it still won't work feel like baning my head against a wall at the moment.

Heeeeeeeeeeeeeeeeeeeeelp please.


Thanks.
ssjtoo Wrote:
laie_techie Wrote:
ssjtoo Wrote:So I added and activated the plugin, enter the info for the image, but when i click add i get the following error...

Quote:MySQL error: 1264
Out of range value adjusted for column 'id' at row 1
Query: INSERT INTO mybb_floating_images (id, name, prefix, url, number, height, time) VALUES ('', 'SnowFlakes', 'sf', 'images/snow.gif', '15', '1000', '60')

What am i doing wrong. >.<

OK, looks like my MySQL server is set up slightly differently than yours. Change that empty string into either null or 0 and tell us if that fixes the error.

This is gona seem like a stupid question, but change it in which file i which folder.? Sad

The file to change is admin/floating_images.php, about line 80. Look for
"id"=>NULL,
and replace with
"id"=>0,
Works fine on my site using IE, ? had to change the location of the image, but hey i have snow lol
K, the change fixed the error which i was receiving.

But now nothing is falling on the page after adding the image.

this is how is setup the file.

Name: Snow
Prefix: Snow1
URL: images/snow.gif
Number: 15
Height: 1500
Time to Live: 60

But after clicking add and refreshing the forums, nothing is falling.


Here is my site address: unified.podzone.net/forum
Debug the error on the following URL: http://unified.podzone.net/forum/jscript..._image.php

It appears you need to change line 13 of global.php

from:
require_once('./inc/init.php');

to:
require_once(dirname(__FILE__) . '/inc/init.php');
laie_techie Wrote:Debug the error on the following URL: http://unified.podzone.net/forum/jscript..._image.php

It appears you need to change line 13 of global.php

from:
require_once('./inc/init.php');

to:
require_once(dirname(__FILE__) . '/inc/init.php');

I changed the code as you suggested but now i am getting the following error.

Warning: Cannot modify header information - headers already sent by (output started at c:\inetpub\wwwroot\forum\global.php:1) in c:\inetpub\wwwroot\forum\inc\functions.php on line 1171

I kind of fumbled my way though setting up the php/mysql/Database/mybb board install on my old WinXP box. Never done anything like it before so its probably something i did wrong at the start of the process. lol

Edit: If i comment out line 1171 the error dissapears, but the floating images still do not fall.

EDIT2: Got it working. Smile
I've included a copy of my functions & global php.
I can't get it to work. How exactly are we supposed to enter the URL? There isn't room to put the whole thing with http://, so what exactly should we put there?
judel Wrote:I can't get it to work. How exactly are we supposed to enter the URL? There isn't room to put the whole thing with http://, so what exactly should we put there?

Enter the URL for what?

If you are talking about the image, you dont need to use the full url. For example, my images are all stored in my images folder for my board, so i put this in the image url section.

images/snow.gif
Pages: 1 2 3 4 5 6 7