Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Chen Zhen on December 24, 2018, 06:44:11 AM

Title: Snowflakes
Post by: Chen Zhen on December 24, 2018, 06:44:11 AM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4199)

Snowflakes Display Modification c/o Chen Zhen
Copyright 2014 - 2023, Chen Zhen @ web-develop.ca
Compatible with the SMF 2.0.X & SMF 2.1.X branches
Requirements: PHP 7.1 or better, modern mainstream browser


This installation process will add options to the mod settings template
which will allow an administrator to opt various types of snowflake and animated image scripts.
This will allow all your users to view these scripts on all of your website pages.

Distributed under the GNU Lesser General Public License version 3 (https://opensource.org/licenses/lgpl-3.0.html)



Available effects:

Available options:



Version History
---------------
v1.83
+ added: option to disable light effects on vertical cursor range

v1.82
! fixed: save selected image in Snowflakes admin

v1.81
! fixed: abs() no longer supports numeric conversion in PHP 8.0.0+

v1.80
! fixed: check if array is set in HTTP mobile headers function

v1.79
+ added: default actions that render Snowflakes disabled
! removed: redundant/duplicate code from some files
! fixed: majority of the main scripts loaded after the DOM
! fixed: top_section/welcome container detection to hide lights during user interface

v1.78
! fixed: undefined variable concerning current action

v1.77
+ added: option to hide the Google Translate Toolbar
! fixed: all lights/snowflakes containers contain the notranslate class in case of Google Translate usage

v1.76
! fixed: check $_REQUEST where $context action|sub-action are not available

v1.75
+  added: additional native JavaScript files
!* fixed: check for JQuery prior to adding its library (SMF 2.0)
!* fixed: buffer amendments function reworked
!  fixed: uninstall process now removes all JavaScript files

v1.74
! fixed: no image directory check for empty path name

v1.73
! fixed: Xmas Wired Lights display none/flex for mouseover/mouseout
! fixed: Diverse & Fireworks use last child of body tag instead of #wrapper id
! fixed: missing concatenating assignment operator for $context['settings_insert_below']
! fixed: body overflowY & position properties for Fireworks
! fixed: Xmas Light Strands script for SMF 2.0

v1.72
! fixed: conflict with SMF 2.0.X branch post preview template

v1.71
! fixed: checking if constants are already defined

v1.7
+ added: new wired lights effect
! fixed: mobile/tablet detection
! fixed: snowstorm options for SMF 2.0 branch
! fixed: explosion animation for smash lights effect

v1.62
+ added: mouseenter/mouseover events for menus and search
+& added: admin options for mouseover/mouseenter events
! adjusted ion.sound to only use HTML5 audio
! fixed: onload event for various scripts that do not use JQuery (affects SMF 2.0)

v1.61
+ added: one additional light smash mp3 file
! fixed: smash lights script to only play one sound per bulb smash
! fixed: smash lights script to ensure it only loads one instance

v1.6
+& added: new light strands effect
+ any script requiring sound will now use the Ion.Sound 3.0.7 plug-in
+ all scripts are now compressed for stable versions
- SoundManager2 completely removed from smash lights script
! fixed: Javascript objects for snowstorm effect
! fixed: admin settings for snowstorm effect
! fixed: Javascript for smash lights effect
! fixed: Javascript node for smash lights effect now loaded using DOM
! fixed: css for exploding lights
! fixed: default offset height for smash lights effect on SMF 2.1 branch
! fixed: default settings for smash lights effect no longer sets or disables append & admin-view options

v1.5
+& added: mobile detection as another disable option
+& added: tablet detection as another disable option
+& license changed to: GNU Lesser General Public License version 3
! permission settings fixed: for both SMF branches
! profile menu icon fixed: for SMF 2.0 branch

v1.42
+& added: profile permissions to the Snowflakes admin template
+& disabling Snowflakes for actions/subactions behavior has changed (see help text in admin)
! fixed: misspelled help text
! fixed: member database function (missing key column for replace/insert)

v1.41
+& added: permission to allow membergroups profile option of enable/disable Snowflakes
! fixed: profile and permission functions
! fixed: SMF 2.1 profile area hook

v1.4
+& added: admin options to disable Snowflakes during specific SMF actions and/or subactions

v1.3
+ updated included JQuery library to v3.3.1
+ added: admin option to select Xmas lights container height
- removed utf-8 language files (existing language files are utf-8)
- eliminated redundant flash files
! fixed: deprecated msie detection
! fixed: css for lights
! fixed: instance of window.onload changed to eventListener
! fixed: instances of (window).load(function(){...}) changed to (window).on("load, function(){...})
! lights offset now "em" instead of "px" and floating value input allowing negative to positive range: -10.99 to 10.99

v1.2
+ added: random Snowflake script option
+ added: optional top px offset value for Xmas Lights script
! fixed: help text
! fixed: token validation for SMF 2.1.X
! fixed: image resizing for invalid or corrupt file types
! fixed: form multipart/form-data on Snowflakes admin template
! Snowflakes image folder no longer removed during the uninstall process

v1.1
+ Snowflakes now utilizes its own snowflakes_settings table
+ all settings are now mostly script/effect specific
+ added: lightbulbs script
+ installer now applies defaults where no settings exist for specific scripts
+ users have option to disable Snowflakes within their profile settings
+ membergroup permissions
+ file edit no longer necessary
! fixed: issue within snowflakesSMF.php file which affected some environments

v1.0
+ adds options for Snowflakes under the heading of Modification Settings
+ many options available for control ( more are pending )
+ 7 optional scripts available for varied effects

Disclaimer:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.




Title: Re: Snowflakes
Post by: Steve on December 24, 2018, 11:09:50 AM
Nice job! The only thing I could wish for is the ability to have more than one choice selectable (not counting the random option). :)
Title: Re: Snowflakes
Post by: -Rock Lee- on December 24, 2018, 04:40:39 PM
It seems pretty good, I'll install it in a test forum to see it better. Great job @Chen Zhen


Regards!
Title: Re: Snowflakes
Post by: Chen Zhen on December 24, 2018, 09:13:01 PM

Thanks  ;D

Quote from: Steve on December 24, 2018, 11:09:50 AM
Nice job! The only thing I could wish for is the ability to have more than one choice selectable (not counting the random option). :)

The random effect option lets you opt the effects you want in the form of a check list.
Do you mean to let the member opt the effect instead of just the Admin?
Title: Re: Snowflakes
Post by: Steve on December 25, 2018, 11:02:36 AM
As I understand it, the random effect rotates through whatever is checked so that there is only one effect happening at a time.

I wish I could select two or more of the effects and have them all show at the same time.

But that's only a wish. Like I said, great job on the mod as it is. :D
Title: Re: Snowflakes
Post by: Chen Zhen on December 27, 2018, 06:27:04 PM
I just released version 1.6 which has some important updates.
Please uninstall plus delete the older version, then download & install the newer one.
Read the change-log in the app or in this mods initial post for details.

This update mainly concerns fixing the snowstorm & lights effects.
It also adds a newer light-strands effect.

The lights effect was previously using Soundmanager2 and its script was conflicting with other jQuery on the page.
This has been fixed in Snowflakes v1.6 along with using ion.sound v3.0.7 instead of Soundmanager2.




@Steve:
I can look into what you requested although I will have to test them with each other to see if they do not conflict (variable & function wise).
Having that many scripts running on the page at one time may almost certainly cause a performance concern.



Title: Re: Snowflakes
Post by: Steve on December 28, 2018, 08:49:29 AM
No worries Chen Zhen. It was only wishful thinking and I don't want you going through a lot of work just to do this.

Thanks for the update. :D
Title: Re: Snowflakes
Post by: Steve on December 28, 2018, 08:56:30 AM
Hmm ... I see only options for the snowflakes. No lights, no bats, etc.
Title: Re: Snowflakes
Post by: Chen Zhen on December 28, 2018, 01:20:29 PM
@Steve:

I just tested it on both SMF 2.0 & SMF 2.1 branches.
As well as installing when it was installed previously and when it was not.
In all scenarios it functions as expected with no PHP errors, no Javascript errors, no conflicts and nothing missing in any admin menu.
Although this was using the default theme in those tests.
What theme are you using?


I can not seem to duplicate what was reported.
Please uninstall it from your forum, clear the forum cache, clear the browser cache/history, download the version from here again and then install it.
Let me know if it works properly or not after those steps.

Thanks.

Title: Re: Snowflakes
Post by: Steve on December 28, 2018, 02:00:46 PM
My apologies Chen Zhen. I'm an idiot. I totally missed the dropdown box which switches effects. It works as advertised. (https://i.imgur.com/Wm1mvsd.gif)
Title: Re: Snowflakes
Post by: Chen Zhen on December 28, 2018, 02:09:39 PM
@Steve:
No problem and I'm glad it works as expected.




Even though I chose the name "Snowflakes", it has many effects including the ability to customize the images for "Diverse" & "Halloween".
Diverse provides a drop effect and Halloween provides a hover effect.
Which have options to change size, density, speed, images, etc.
You can make floating bees, leaves, falling rain drops or whatever you want.

What I should do is provide the ability to save multiple configurations for those 2 options.

Title: Re: Snowflakes
Post by: Chen Zhen on December 29, 2018, 01:00:08 AM

Snowflakes v1.61 is now available.

This update fixes issues with the smash lights effect.
Please read the change-log located in the initial post of the thread for details.

Regards.
Title: Re: Snowflakes
Post by: landyvlad on January 01, 2019, 11:46:35 PM
Anyone have a link to a forum where this is in use so I can see what it looks like ?
Title: Re: Snowflakes
Post by: Chen Zhen on January 04, 2019, 12:00:52 AM

Snowflakes has been updated to version 1.62.
This update includes some bug fixes and extra admin options.

The newer settings can make it so when a user has their mouse over specific HTML/XHTML containers, the lights will be temporarily disabled.
This will allow you to have those lights at the top in the position you want but not interfere with any links or navigation.




@landyvlad:

I have this mod enabled on my website and it is set to random.
You can click on the Forum link in the nav bar multiple times to see different effects.
However, due to the season I have 2 of the effects turned off (6 are enabled).
Title: Re: Snowflakes
Post by: Chen Zhen on January 11, 2019, 09:50:28 PM

Snowflakes has been updated to version 1.7
This update includes some bug fixes and another added wired lights effect.
The new effect has multiple image options including the ability to add your own images.
Title: Re: Snowflakes
Post by: Dave J on September 28, 2019, 08:53:44 AM
Hi,

Not working in SMF 2.1 RC2 with default theme.

Installs without error but when clicking on 'settings' just gives a blank page. Nothing listed in error log either.

6 hooks installed and listed as active.

No other mods installed.

Works OK on 2.0.15
Title: Re: Snowflakes
Post by: Dave J on November 01, 2019, 01:17:11 PM
Quote from: davejo on September 28, 2019, 08:53:44 AM
Hi,

Not working in SMF 2.1 RC2 with default theme.

Installs without error but when clicking on 'settings' just gives a blank page. Nothing listed in error log either.

6 hooks installed and listed as active.

No other mods installed.

Works OK on 2.0.15

Update:

It doesn't play nice with SMFPacks Shoutbox in 2.0.15. When enabled it has the error as seen in the first & second image below. When I activate 'Apend to body' the error is then smaller as seen in the second/third image below.

There are no erros in the SMF log and no errors on the cPanel either. I've tested it on various different themes including default and different sites. The php for all sites is 5.6. I have tested it on the Pro version and free version of the Shoutbox with the same results.

It's such a shame as I really like this mod.
Title: Re: Snowflakes
Post by: Chen Zhen on November 04, 2019, 10:05:21 PM

I would take a look at what you reported but atm it appears the SMF 2.1 version of that shoutbox mod is paid/pro only.
Although I suppose I can test the SMF 2.0.15 version from this forum to see if it has the same problem you reported.

Title: Re: Snowflakes
Post by: Dave J on November 05, 2019, 03:42:37 AM
Quote from: Chen Zhen on November 04, 2019, 10:05:21 PM

Although I suppose I can test the SMF 2.0.15 version from this forum to see if it has the same problem you reported.

Thanks Chen I would really like to use this mod.
Title: Re: Snowflakes
Post by: Chen Zhen on November 10, 2019, 05:00:42 PM

I just tested this on SMF 2.0.15 with the SMF Packs shoutbox installed and enabled.
Both mods seem to be working without conflict.
Atm I am not able to duplicate the javascript issue you reported (as per your first posted image).
Title: Re: Snowflakes
Post by: Dave J on November 11, 2019, 08:29:39 AM
Quote from: Chen Zhen on November 10, 2019, 05:00:42 PM

I just tested this on SMF 2.0.15 with the SMF Packs shoutbox installed and enabled.
Both mods seem to be working without conflict.
Atm I am not able to duplicate the javascript issue you reported (as per your first posted image).

Thanks for looking Chen,

Not sure what it can be then as I tested it with the free shoutbox version on 3 different sites with the same issue all using the default theme.

I will do the same as you and test it on a new install and see what happens, perhaps it's a host thing.
Title: Re: Snowflakes
Post by: Dave J on November 11, 2019, 01:58:20 PM
Hi Chen,

Ok did the same as you and you are correct that there are no errors, see image attached.

So now I don't know what the issue is, I guess that there is a JS conflict somewhere that is one step too much. I might try to install the other mods I have on the live site, on the test site, and see if I can get the the root of it.

Thank you for at least looking

Title: Re: Snowflakes
Post by: Chen Zhen on November 12, 2019, 12:10:04 AM

Yes install your other mods one at a time until you find the culprit.
Title: Re: Snowflakes
Post by: Dave J on November 19, 2019, 02:31:05 PM
OK now found out what the issue is. I should add that this was done on a new install of 2.0.15 with PHP5.6

It's all related to the SMF Smileys settings.

If you have Smileys that you don't want to show on the 'Post Form' and opt for the 'Pop Up' then this is when the error happens.

If you set all your smileys to 'Post Form' the error is not there, as seen in image 4, so obviously now that's what I've done...not sure if this can be called a bug or not and if it is who's bug is it?

I have taken screen shots, see below
Title: Re: Snowflakes
Post by: Dave J on November 23, 2019, 07:55:03 AM
It's worth noting that this doesn't happen on the new topic posting page nor on the reply to post either.
Title: Re: Snowflakes
Post by: Chen Zhen on November 23, 2019, 12:25:42 PM
Quote
If you have Smileys that you don't want to show on the 'Post Form' and opt for the 'Pop Up' then this is when the error happens.

I'm looking at the smiley settings in a localhost setup of SMF 2.0.15 right now and I do not see those settings.
Are you positive that this is not settings added by some sort of mod or am I looking in the wrong admin template?

Please provide a screenshot that shows the appropriate admin sub-menu that includes those settings.
Title: Re: Snowflakes
Post by: Arantor on November 23, 2019, 12:33:38 PM
Looks like a shoutbox mod combined with customised smileys being enabled.
Title: Re: Snowflakes
Post by: Dave J on November 24, 2019, 03:51:49 AM
Gents,

Just started from scratch again to try and get some idea of this. I know you probably know all this but I'm also trying to get a handle on why this is happening but can't so I'm hoping you guys will.

So on a new install I left the 'Smileys' to default...image 1

Next I checked the box for 'Enable customised smileys' (no new set installed)...image 2

This then expands to menu for smileys to enable you to choose to edit them etc..image 3

I edtied the 'Afro' smiley so it would be seen on the pop up

I then install Shoutbox, post a test message, when I click on the smiley button you can see the option for 'more' is at the end...image 4

Now I install 'Snowflakes' and enable it, go back to the shoutbox and in image 5 you can see the results.

It seems that everything is OK when it's just the shoutbox installed and Snowflakes is not enabled. I obviously don't know where the issue lies this is only my interpretation of the issue.

I should also add there are no errors in the SMF error log and none in the cPanel host error log either

On the live site I've now discabled all the pop up smileys so this doesn't happen anymore.

So I will leave it to you to ponder.
Title: Re: Snowflakes
Post by: Chen Zhen on November 24, 2019, 11:33:56 PM
That shoutbox mod has some poorly written javascript and HTML.
Take a look using a validator and you will see what I am referring to.
The author used document.write which IMO should perhaps be used during testing but not for stable usage.
DOM is usually the preferred method.. perhaps they improved the pro version.

Anyhow.. here is a template file you can use as a replacement for that mod.
It should be placed in the Themes/default directory to overwrite that mod's file.
Your smileys popup now appears directly above the shoutbox.

I did not test it thoroughly to include multiple smileys displayed in the popup.
Test it out and let me know if there is a problem with it.
Title: Re: Snowflakes
Post by: Dave J on November 25, 2019, 02:47:08 AM
Thanks Chen I'll check it out


OK replaced the original with your version Chen and it's all working OK. Thank you very much for your help, it's much appreciated.
Title: Re: Snowflakes
Post by: Dave J on November 25, 2019, 04:04:18 AM
Quote from: davejo on November 25, 2019, 02:47:08 AM
Thanks Chen I'll check it out


OK replaced the original with your version Chen and it's all working OK. Thank you very much for your help, it's much appreciated.

OK another update. I suppose I really should have checked everything but just checked the pop up smiley issue.

The file you have posted will clear that issue but then if you try to go in to 'Setting' in Admin it says that the tempate can't be found.

I have resolved that by re-inserting the code from the end of the original shoutbox.template file into the one you have created.

There are a couple of other issues too but I'll try to resolve those myself.

I just wanted to post this here incase someone else has the same problem and then replaces the original file with yours Chen

If it helps I have attched the original template for the original Pro V13 shoutbox mod. As my license has expired I cannot get a more recent version of the file which might of course resolved the issue.

I do appreciate what you have done though Chen, thank you.
Title: Re: Snowflakes
Post by: Chen Zhen on November 25, 2019, 09:05:36 PM

I found some suspected issues with that last file.
Attached to this post is your edited template for the pro version of SMF Packs Shoutbox.
It will now work with multiple smileys in the "more" popup.
Title: Re: Snowflakes
Post by: Chen Zhen on November 25, 2019, 09:07:33 PM

The file attached to this post is for the public version of SMF Packs shoutbox.
I add this in case anyone else is looking for the same fix but for the public version.
Title: Re: Snowflakes
Post by: Dave J on November 26, 2019, 04:10:23 AM
Quote from: Chen Zhen on November 25, 2019, 09:05:36 PM

I found some suspected issues with that last file.
Attached to this post is your edited template for the pro version of SMF Packs Shoutbox.
It will now work with multiple smileys in the "more" popup.

Thanks again Chen, I will have a look
Title: Re: Snowflakes
Post by: Chen Zhen on November 26, 2019, 07:33:51 PM

Actually use the one attached to this post.
It should add a space before a smiley (not after).
Title: Re: Snowflakes
Post by: Dave J on November 27, 2019, 02:07:43 AM
Hi Chen,

The other one seemed to work ok and the new one does too. I now have the site running with no errors and the Snowflakes works with the shoutbox.

Once again thank you for all your help
Title: Re: Snowflakes
Post by: Shades. on November 25, 2020, 10:15:50 AM
Sorry I posted this in another thread b4 but figured I'd post it here since I believe this mod is causing my problems. ;)

I'm have an issue when previewing a post. At  the end I get "null null". But when I actually post something the "nulls" arent there. So I uninstalled this mod and the "null null" on preview post was not there. Then I reinstalled this mod and the "nulls" showed up again. Any ideas? (see attachment)

This mod installed on SMF2.0.17

I also installed it on 2.1RC3 and no problems
Title: Re: Snowflakes
Post by: Chen Zhen on November 25, 2020, 07:27:16 PM

Navigate to its admin settings and enter the appropriate action in the disable input field:


List actions/subactions to disable Snowflakes (comma separated)


An example setting:

post


.. this will disable the mod when someone is making or editing a post.
Title: Re: Snowflakes
Post by: Shades. on November 26, 2020, 06:38:29 AM
Quote from: Chen Zhen on November 25, 2020, 07:27:16 PM

Navigate to its admin settings and enter the appropriate action in the disable input field:


List actions/subactions to disable Snowflakes (comma separated)


An example setting:

post


.. this will disable the mod when someone is making or editing a post.

Ok, well that stopped the snowflakes while editing or posting but still getting that "null null" on preview!? Its not really a problem cause it post normal but would like to figure out whats causing it. Must be having conflict between this mod and another cause when I uninstall this one the "null null" is not there. :o
Title: Re: Snowflakes
Post by: Chen Zhen on November 26, 2020, 08:33:52 PM

I am able to duplicate the problem on the SMF 2.0 branch.
Although when disabled for that action it doesn't load any of its css or JavaScript nor does it show any console errors.

I can give you a temporary patch for your post template until I can resolve the problem without parsing/editing SMF files.

file: ../Themes/default/Post.template.php

find:
bodyText += preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue;

replace with:
bodyText += preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue ? preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue : "";
Title: Re: Snowflakes
Post by: Shades. on November 27, 2020, 10:26:36 AM
Quote from: Chen Zhen on November 26, 2020, 08:33:52 PM

I am able to duplicate the problem on the SMF 2.0 branch.
Although when disabled for that action it doesn't load any of its css or JavaScript nor does it show any console errors.

I can give you a temporary patch for your post template until I can resolve the problem without parsing/editing SMF files.

file: ../Themes/default/Post.template.php

find:
bodyText += preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue;

replace with:
bodyText += preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue ? preview.getElementsByTagName(\'body\')[0].childNodes[i].nodeValue : "";
Works great now thanks!
Title: Re: Snowflakes
Post by: Chen Zhen on November 30, 2020, 12:34:54 AM

Snowflakes has been Updated to version 1.72.




v1.72
! fixed conflict with SMF 2.0.X branch post preview template




@Shades:
Thanks for the report!
You can revert the previous edit if you decide to update the mod.
Title: Re: Snowflakes
Post by: Shades. on November 30, 2020, 05:41:24 PM
Updated and it works great thank you! 8)
Title: Re: Snowflakes
Post by: Dave J on December 04, 2020, 02:17:59 AM
Hi Chen,

The diverse setting is not working on any site that's using the 'Xmas' theme, any idea what it could be?. I am admin on 3 sites and it doesn't work on any of them, as soon as I refer back to our default theme it's OK.

All other selections work fine.

Using v1.72
SMF 2.0.17. PHP 5.6

regards

Dave

PS> It's disabled for mobile and tablet as something makes the page seem go go in and out on my tablet 'Tab S6'
Title: Re: Snowflakes
Post by: rusbowden on December 04, 2020, 01:03:29 PM
I have SMF 2.1 RC3. I installed snowflakesSMF_v1.7x and it crashed my forum with a 503
Title: Re: Snowflakes
Post by: rusbowden on December 04, 2020, 03:06:30 PM
Quote from: rusbowden on December 04, 2020, 01:03:29 PM
I have SMF 2.1 RC3. I installed snowflakesSMF_v1.7x and it crashed my forum with a 503

More info.

I am wondering if the issue is that Snowflakes is incompatible with the Lunarfall_v0.7.1. 

No matter, my question is Now what do I do?




Title: Re: Snowflakes
Post by: Chen Zhen on December 04, 2020, 09:36:41 PM
@davejo:
You are correct as I just tested it on a custom theme and the diverse setting is not working.
I will look into it & thank you for the report.




@rusbowden:
I just tested it on SMF 2.1 RC3 with the Lunarfall theme whereas everything seems to be working just fine without errors.
Snowflakes does not edit any SMF files because it uses hooks therefore as long as it added the hooks to your DB properly and its Source files exist in the proper directory (../Sources) then it should be functioning properly.

If you think you have an issue with a theme you can always use ../index.php?theme=1 in the URL to use the default theme although I doubt that is the problem.
Snowflakes is disabled for your Admin section by default (so long as you didn't enable that setting for it) therefore you can try to use ../index.php?action=admin in your URL to navigate to your admin section leaving snowflakes disabled in the process.
From there you should be able to uninstall the mod.
Title: Re: Snowflakes
Post by: rusbowden on December 04, 2020, 09:47:41 PM
Quote@rusbowden:
I just tested it on SMF 2.1 RC3 with the Lunarfall theme whereas everything seems to be working just fine without errors.
Snowflakes does not edit any SMF files because it uses hooks therefore as long as it added the hooks to your DB properly and its Source files exist in the proper directory (../Sources) then it should be functioning properly.

If you think you have an issue with a theme you can always use ../index.php?theme=1 in the URL to use the default theme although I doubt that is the problem.
Snowflakes is disabled for your Admin section by default (so long as you didn't enable that setting for it) therefore you can try to use ../index.php?action=admin in your URL to navigate to your admin section leaving snowflakes disabled in the process.
From there you should be able to uninstall the mod.

The crash was immediate upon installation. If not the theme, then something. It's uninstalled for good now.

Thanks for looking into it.
Title: Re: Snowflakes
Post by: sahabatkarpetmasjid on December 04, 2020, 10:11:20 PM
Omg this is what im looking for, thank you thank you
Title: Re: Snowflakes
Post by: Chen Zhen on December 06, 2020, 10:59:21 PM

Snowflakes has been updated to version 1.73.

v1.73
! fixed: Xmas Wired Lights display none/flex for mouseover/mouseout
! fixed: Diverse & Fireworks use last child of body tag instead of #wrapper id
! fixed: missing concatenating assignment operator for $context['settings_insert_below']
! fixed: body overflowY & position properties for Fireworks
! fixed: Xmas Light Strands script for SMF 2.0

@davejo: Diverse should now work for you on all your themes.
Title: Re: Snowflakes
Post by: Dave J on December 07, 2020, 02:06:18 AM
Quote from: Chen Zhen on December 06, 2020, 10:59:21 PM
@davejo: Diverse should now work for you on all your themes.

Thanks very much Chen
Title: Re: Snowflakes
Post by: Dave J on December 07, 2020, 04:37:04 AM
Hi Chen,

On updating and then checking the mod it seems that 2 of the sites get the following error (see attachment) when clicking on the save button. The 3rd site gets no errors at all.

The only difference for the sites is that 2 (with the errors) are on one host and the third (with no errors) is on a different host

I should add that there is nothing wrong with the mod working, the diverse is now OK and so is everything else
Title: Re: Snowflakes
Post by: Chen Zhen on December 07, 2020, 06:03:28 PM
I suppose it's possible that a PHP setting (such as open_basedir) may be causing more restrictive behavior.
No problem.. I adjusted it yet again but I'd like you to try it first (from my site) & let me know if it works without error on those 2 websites before I release it here.

ref.
https://web-develop.ca/index.php?action=downloads;area=stable_smf_modifications;file=37

Thanks.
Title: Re: Snowflakes
Post by: Dave J on December 08, 2020, 02:09:04 AM
Hi Chen,

I uploaded to site 1 and it worked fine no errors once installed. Site 2 still had the issue, then I checked the php version being used and it was different @ 5.6 so changed to php 7 and now it's working fine.

The host had changed the php version from 5.6 to 7 on my personal site that's why it worked ok.

So all sites are now working OK working on php 7

Thanks for your help Chen
Title: Re: Snowflakes
Post by: Chen Zhen on December 08, 2020, 09:39:47 PM

This mod has been updated to version 1.74.

v1.74
! fixed: no image directory check for empty path name




@davejo:
You should update here or on my site again even though it shows the same version.
What you downloaded was just a quick test but I found something that needed adjustment which has been applied to the proper release.
Title: Re: Snowflakes
Post by: Dave J on December 09, 2020, 01:23:26 AM
Quote from: Chen Zhen on December 08, 2020, 09:39:47 PM
@davejo:
You should update here or on my site again even though it shows the same version.
What you downloaded was just a quick test but I found something that needed adjustment which has been applied to the proper release.

Ok Chen will do. Thank you for all your help.
Title: Re: Snowflakes
Post by: jsx on December 15, 2020, 12:42:39 PM
@Chen Zhen

I turned on the snowflakes, but unfortunately not all options work. These options don't work:

Diverse
Fireworks
Xmas Lights
Xmas Lights Strands
Xmas Wired Lights

What could be causing this?
Title: Re: Snowflakes
Post by: Chen Zhen on December 15, 2020, 10:12:15 PM

Is this regarding the SMF 2.0.X branch?

If it is then try enabling/disabling the jQuery library in Snowflakes settings.
Those effects need jQuery but this mod should only load the library if it is not already available from another mod.
Title: Re: Snowflakes
Post by: jsx on December 16, 2020, 06:20:02 AM
Yes, the forum runs on SMF 2.0.17

I installed the latest version of this mod 1.74 and only these effects are not displayed:

Xmas Lights
Xmas Lights Strands
Xmas Wired Lights

Quote from: Chen Zhen on December 15, 2020, 10:12:15 PM
If it is then try enabling/disabling the jQuery library in Snowflakes settings.
Those effects need jQuery but this mod should only load the library if it is not already available from another mod.

All effects are displayed correctly in the test forum. But on the official forum, unfortunately the lights do not show on the enabled or disabled jQuery library. I have SMFPacks Shoutbox Pro installed on the forum, maybe is an incompatibility here?

The same error occurs in the forum:

https://www.simplemachines.org/community/index.php?topic=564196.msg4037928#msg4037928
Title: Re: Snowflakes
Post by: Chen Zhen on December 16, 2020, 07:07:49 PM

The attachment for this post: [Click Here] (https://www.simplemachines.org/community/index.php?topic=564196.msg4038645#msg4038645) ... is a replacement file for that shoutbox mod. Try it out to see if it resolves your problem.
Title: Re: Snowflakes
Post by: Steve on December 16, 2020, 07:45:43 PM
It does in fact, resolve the same problem I had with one minor glitch. When I go to my forum's index page the shoutbox loads normally, At it's next automatic refresh, it hangs up. Refreshing the page resolves that problem.


Edit: it doesn't seem to be doing it now so maybe it was a problem on my end. I have some custom mods which may be interfering.
Title: Re: Snowflakes
Post by: Chen Zhen on December 16, 2020, 08:17:03 PM
For SMF Packs Shoutbox make sure you download the appropriate file because 1 is for pro and the other is for the free version.
The pro version has a different file that loads some sort of modal JS library.
Title: Re: Snowflakes
Post by: Steve on December 16, 2020, 08:30:41 PM
I'm sorry but which one is for Pro?

This one?:

https://www.simplemachines.org/community/index.php?topic=564196.msg4038645#msg4038645
Title: Re: Snowflakes
Post by: Chen Zhen on December 16, 2020, 10:26:22 PM
Yes but I haven't tested the pro file because I do not have that version.
If I remember correctly all I did was edit that file with similar edits that I did to the public file.

The public version works fine for me.

Note that you can't test it with 2 windows opened in the same browser.
If you're going to test the shoutbox you need to have 2 different user accounts but log into them using different browsers.
ie. Edge for one user and Chrome for the other.

I believe the shoutbox is designed not to refresh for the same user in the same browser because it updates in the browser you shouted in. 
Title: Re: Snowflakes
Post by: jsx on December 22, 2020, 11:52:39 AM
Quote from: Chen Zhen on December 16, 2020, 07:07:49 PM

The attachment for this post: [Click Here] (https://www.simplemachines.org/community/index.php?topic=564196.msg4038645#msg4038645) ... is a replacement file for that shoutbox mod. Try it out to see if it resolves your problem.

@Chen Zhen

Unfortunately, this file does not solve this problem, these effects are still not displayed: Xmas Lights, Xmas Lights Strands, Xmas Wired Lights

And unfortunately, this file on my forum did not fix the display of the window with additional emoticons. This file from the attachment broke this feature more.

I have SMFPacks Shoutbox Pro 1.4.5 and the Shoutbox.template.php file is v1.4.4

Can you do this for this version? I can attach this file.
Title: Re: Snowflakes
Post by: Chen Zhen on December 27, 2020, 04:46:56 PM

Temporarily uninstall Ohara YouTube Embed and then see if it works.
Title: Re: Snowflakes
Post by: jsx on December 28, 2020, 05:01:39 AM
Unfortunately, these effects still don't work after uninstalling the Ohara YouTube Embed mod.

I would also like to fix this bug. There is a collision between the SMFPacks Shoutbox Pro modification and your modification. Can you help me fix this bug?

(https://i.imgur.com/0aKRfNr.png)
Title: Re: Snowflakes
Post by: billtidy on December 28, 2020, 05:44:00 AM
jsx try using the attached file.

Rename your original file by adding a 1 after the word 'template' then upload this version. It should stop the issue with the shoutbox and also help the snowflakes to work.

What will not work is the 'Smileys' [more] 'Pop Up' button, although the smileys you have on the 'Post form' will still work.

If you switch off  'Snowflakes' at the end of the festive season then rename this file to 2 and rename the original file by removing the 1, then the shoutbox will work as normal.
Title: Re: Snowflakes
Post by: Steve on December 28, 2020, 07:56:24 AM
Why would someone fix one problem knowing it will create another?
Title: Re: Snowflakes
Post by: jsx on December 28, 2020, 01:43:24 PM
Quote from: billtidy on December 28, 2020, 05:44:00 AM
jsx try using the attached file.

Rename your original file by adding a 1 after the word 'template' then upload this version. It should stop the issue with the shoutbox and also help the snowflakes to work.

What will not work is the 'Smileys' [more] 'Pop Up' button, although the smileys you have on the 'Post form' will still work.

If you switch off  'Snowflakes' at the end of the festive season then rename this file to 2 and rename the original file by removing the 1, then the shoutbox will work as normal.

However, I want the additional smileys window to display properly.
Title: Re: Snowflakes
Post by: Chen Zhen on December 28, 2020, 04:42:27 PM
I mentioned the Ohare Youtube mod because it uses document.write which can cause problems with other JavaScript on the page.  Imo developers should be using DOM to insert script tags & not document.write at all. The latest JQuery library makes it extremely easy to do that using $.getScript().

Unfortunately I can not test any changes to your Shoutbox Pro mod because I do not have a copy of it at all. For me to test any changes I make to any of its files requires me to have a legal copy of it which I'm not willing to pay for. For me to make blind changes to one of its files & upload it for you to test is too much trouble. You can ask the shoutbox mod author who may be willing to help you out.
Title: Re: Snowflakes
Post by: billtidy on December 29, 2020, 02:22:10 AM
Quote from: Steve on December 28, 2020, 07:56:24 AM
Why would someone fix one problem knowing it will create another?

In it's present state it doesn't work at all, so the attached file lets it work with just the minor issue of the pop up window not working. Both of these mods have always not worked together, alone they work perfectly, so my fix is, admittedly only a limited fix, but a fix none the less.

It better to have something working rather than nothing, wouldn't you agree Steve?

The file I attached file was from the pro version of the shoutbox mod.
Title: Re: Snowflakes
Post by: Steve on December 30, 2020, 10:04:46 AM
Quote from: billtidy on December 29, 2020, 02:22:10 AMIt better to have something working rather than nothing, wouldn't you agree Steve?

Actually, in the case of mods, no, I wouldn't agree. BUT, that's just me. Your solution may work for others and the time and effort you put in to get it to work this much is appreciated. (https://i.imgur.com/Wm1mvsd.gif)
Title: Re: Snowflakes
Post by: Chen Zhen on December 30, 2020, 09:49:34 PM

The solution is to replace document.write() with proper DOM object manipulation.
Anyone who is JavaScript savvy & has access to the pro version should be able to perform the edits to that modification's file(s).
In my opinion if the author of that shoutbox mod is still active & supports that package then simply ask him/her to do just that.
I assure you it will fix the problem. 
Title: Re: Snowflakes
Post by: jsx on January 02, 2021, 11:57:18 AM
@Chen Zhen

When I uninstalled TinyPortal 2.0.0 these effects display correctly: Xmas Lights, Xmas Lights Strands, Xmas Wired Lights

So it would be nice if you checked what causes this mistake.
Title: Re: Snowflakes
Post by: Chen Zhen on January 03, 2021, 03:11:00 PM

@jsx: Please stop frequently PMing me to look at your posts.

You can download & try this version here:
https://web-develop.ca/index.php?action=downloads;area=stable_smf_modifications;file=37

I have to test it for a while which is why it is a RC version release. There may be unforeseen bugs due to the minor changes.
When it appears to have no problems, I will post a stable release here & on my forum (no RC in its title/name).



Title: Re: Snowflakes
Post by: jsx on January 03, 2021, 04:42:17 PM
@Chen Zhen

Okay if you have a problem with that.

I installed this version from your link and these effects are showing now.

But after refreshing the forum, for example, the lamps breaking effect does not work and no sound heard.

But when the Flurry effect is enabled, when I browse the forum on Chrome on my smartphone, the forum moves. I saw this bug on the previous version of your modification.

When the Snowstorm effect is enabled, this effect is not displayed on the smartphone when browsing the forum.
Title: Re: Snowflakes
Post by: Chen Zhen on January 03, 2021, 07:55:10 PM
Many of the snow & image effects will likely raise your CPU usage for smartphones.
You can run your own tests to see if that statement holds true.
For this reason I included admin options to disable the effects for smartphones and/or tablets.
I suggest disabling the effects for both which will affect people using mobile browsers.
 
Thanks for the reports.
Title: Re: Snowflakes
Post by: jsx on January 04, 2021, 02:48:32 PM
I understand.

I have the Flurry effect enabled and from time to time the forum seems to be reloading, a flash appears. Why is this happening?
Title: Re: Snowflakes
Post by: Chen Zhen on January 04, 2021, 05:22:32 PM
Prior to the recent changes I have not seen that behavior on desktop/laptop. Also using Simple Portal or EhPortal I never had those problems with any of the light scripts.
Other than the use of document.write() from TP, I don't see any JS errors on the page yet something is causing a problem. Even after replacing document.write() with DOM manipulation the incorrect behavior persists.
Title: Re: Snowflakes
Post by: jsx on January 06, 2021, 01:10:37 PM
Quote from: Chen Zhen on January 04, 2021, 05:22:32 PM
Prior to the recent changes I have not seen that behavior on desktop/laptop. Also using Simple Portal or EhPortal I never had those problems with any of the light scripts.

Unfortunately, while browsing the forum on the monitor, I see blinking from time to time.
Title: Re: Snowflakes
Post by: lemur21 on January 09, 2021, 11:29:13 PM
Looks like I'm having a similar issue (running 2.0.17)

I am able to see *some* of the effects; but not all.

I am not able to see these effects:

Snowflake
Flurry
Diverse
Fireworks
Halloween

I *can* see the Snowstorm and all the Xmas lights effects.

Weird :/
Title: Re: Snowflakes
Post by: Chen Zhen on January 14, 2021, 08:02:50 PM

@jsx:

Try the v1.75-RC2 version from my forum at the link I previously gave you in this thread.
I reworked the buffer hook function quite extensively.




Keep in mind that any JavaScript / (X)HTML errors from other 3rd party mods, custom portal blocks and/or your own file edits may cause this mod's scripts to fail.
This has been tested while also having Tiny Portal installed.
ref. to possible current TP issue/scenario:
https://github.com/Tinyportal/TinyPortal/pull/816/files
Title: Re: Snowflakes
Post by: jsx on January 17, 2021, 06:59:28 AM
I installed this version v1.75-RC2 and I noticed two flashes on the screen while writing a private message on the forum. It is possible that this is a bug in JavaScript from another modification installed.
Title: Re: Snowflakes
Post by: Chen Zhen on January 17, 2021, 11:30:48 AM
I can see on your forum page that document.write is invoked approx. 6 times and it appears a JQuery library is being loaded more than once.
Due to one of your mods there may be more problems on the actual post page but I'd have to register to test that out.

- Lex removed a web address on request.
Title: Re: Snowflakes
Post by: jsx on January 18, 2021, 03:00:44 AM
Quote from: Chen Zhen on January 17, 2021, 11:30:48 AM
Due to one of your mods there may be more problems on the actual post page but I'd have to register to test that out.

I sent you private messages. One of them contains data to log into the account.
Title: Re: Snowflakes
Post by: Chen Zhen on January 18, 2021, 04:26:22 PM
Quote from: jsx on January 17, 2021, 06:59:28 AM
I installed this version v1.75-RC2 and I noticed two flashes on the screen while writing a private message on the forum. It is possible that this is a bug in JavaScript from another modification installed.

Update to v1.76

I don't see any flashes on the screen when attempting to write a post or PM.
What you can do is just disable snowflakes for those actions.
Imo it's not a big deal if the effects are not visible when users are actually writing a post or PM.
It will still show when they are reading PM's or browsing the forum posts.

Go to the Snowflakes admin and find the input box for:
QuoteList actions/subactions to disable Snowflakes (comma separated)

enter the following & save the settings.
post,pm~send
Title: Re: Snowflakes
Post by: Shades. on December 10, 2021, 09:41:45 AM
2.1RC4

Getting the following error on newest install:

QuoteError
Type of error
Undefined_vars
Error message
8: Undefined variable: currentAction
File
/home2/*****/public_html/*****/Sources/snowflakesSMF.php
Line
704
URL of page causing the error
https://*****.com/index.php?action=admin;area=modsettings;sa=snowflakes

Backtrace information
#0: smf_error_handler()
Called from /home2/*****/public_html/*****/Sources/snowflakesSMF.php on line 704
#1: smf_snowflakes_buffer()
Called from unknown on line -1
Title: Re: Snowflakes
Post by: Chen Zhen on December 10, 2021, 06:29:02 PM

I fixed the undefined error & updated the modification.
Thanks for the report.
Title: Re: Snowflakes
Post by: Dwev on December 27, 2021, 03:40:55 PM
I had Snowflakes 1.7 installed, everything worked, except Fireworks.

Just installed 1.7.8 and now everything works, except Xmas Lights (which I really liked, and was popular on the forum as well).

Can't make heads or tails why some of the effects do or don't work...

(either way, great mod..!   :D )
Title: Re: Snowflakes
Post by: Chen Zhen on December 27, 2021, 06:57:11 PM
@Dwev:

It might be some sort of JS conflict.
Have you attempted to adjust various settings such as attach to the body or perhaps click on the checkbox that sets the defaults for the lights?

First try to enable "Append to <body> of the HTML page".
Title: Re: Snowflakes
Post by: Dwev on December 28, 2021, 03:57:00 AM
Quote from: Chen Zhen on December 27, 2021, 06:57:11 PM@Dwev:
Have you attempted to adjust various settings such as attach to the body or perhaps click on the checkbox that sets the defaults for the lights?

Never had to that before, so have to admit that I didn't try to do this.  :-*

QuoteFirst try to enable "Append to <body> of the HTML page".

That did the trick, so now everything works!

Thanks a lot for the fast and very helpful reaction!  :D
Title: Re: Snowflakes
Post by: mickjav on December 28, 2021, 05:16:49 AM
Thanks Love it  ;D
Title: Re: Snowflakes
Post by: Steve on December 28, 2021, 08:00:34 AM
Quote from: Chen Zhen on December 27, 2021, 06:57:11 PMFirst try to enable "Append to <body> of the HTML page".

Is that something everyone should do?
Title: Re: Snowflakes
Post by: mickjav on December 28, 2021, 09:25:08 AM
Quote from: Steve on December 28, 2021, 08:00:34 AM
Quote from: Chen Zhen on December 27, 2021, 06:57:11 PMFirst try to enable "Append to <body> of the HTML page".

Is that something everyone should do?

Thats what I had to do with my 2.0.19 my 2.1 RC4 support site seems to work without it.
Title: Re: Snowflakes
Post by: Steve on December 28, 2021, 10:59:34 AM
Thanks.  :)
Title: Re: Snowflakes
Post by: Chen Zhen on December 28, 2021, 04:08:19 PM

SMF Snowflakes has been updated to v1.79.

This release includes some fixes mostly affecting Xmas Lights, Halloween Effects & the user/welcome container detection.

@mickjav & steve:
You should be able to disable that previous setting for your Xmas Lights with this version & going forward.
Please let me know if it works as expected.
Title: Re: Snowflakes
Post by: mickjav on December 28, 2021, 04:49:37 PM
Quote from: Chen Zhen on December 28, 2021, 04:08:19 PMSMF Snowflakes has been updated to v1.79.

This release includes some fixes mostly affecting Xmas Lights, Halloween Effects & the user/welcome container detection.

@mickjav & steve:
You should be able to disable that previous setting for your Xmas Lights with this version & going forward.
Please let me know if it works as expected.

Won't be able uninstall and install version till tomorrow but will let you know thanks.

Mick
Title: Re: Snowflakes
Post by: Chen Zhen on December 28, 2021, 05:07:48 PM

Please take note for anyone updating this modification that the browser history should be initially cleared for the JavaScript changes to take effect.
Title: Re: Snowflakes
Post by: mickjav on December 28, 2021, 06:40:36 PM
Managed to install on my tab turned off <body> and seems to work, I have a few random events selected one seems not to show i'll look more into that tomorrow.

I did clear history before installing.
Title: Re: Snowflakes
Post by: Steve on December 29, 2021, 09:53:19 AM
Checked all events on your latest version and everything seems to be working fine without the "Append to <body> of the HTML page" checked.  :)
Title: Re: Snowflakes
Post by: jsx on December 31, 2021, 05:21:56 AM
@Chen Zhen

I have this modification installed in version 1.79 and youtube videos in Ohara YouTube Embed v1.2.11 modification stopped displaying. When I disable the Snowflakes modification, the videos work again.
Title: Re: Snowflakes
Post by: Chen Zhen on December 31, 2021, 01:34:29 PM
I've already told you why that mod causes a conflict in a previous post from this thread

Ask the author of that mod to replace all of the document.write() with proper DOM manipulation. I'm not going to do it and if the author doesn't want to bother (or anyone capable) then your out of luck She is still occasionally active but ask in her mod thread or on her public forum, do not PM her about mod support like you previously did to me in the past.

Title: Re: Snowflakes
Post by: jsx on January 01, 2022, 04:22:59 AM
I had to forget what you wrote to me because your mod is only used once a year for those few days. And don't educate me about private messages.
Title: Re: Snowflakes
Post by: Steve on January 01, 2022, 07:58:42 AM
Apparently he did as you sent him unwanted PMs. And there will be no more discussion about that in this topic.

Let's keep it on topic, please.
Title: Re: Snowflakes
Post by: Michael Vail on January 07, 2022, 03:18:35 AM
Such a cool mod! I really like how the setting options change when you select the type of effects. Really nice work on this. Thanks you so much. The detail you put into it is amazing.

Happy New Year.
Title: Re: Snowflakes
Post by: petewadey on February 13, 2022, 04:49:17 AM
I'm getting the following error messages

/smf/index.php?PHPSESSID=b9f061190472c83f5bd0a680f65e5bb9&amp;action=dlattach;topic=11051.0;attach=32078;image;ts=1553017207
8: Trying to access array offset on value of type null
/smf/Sources/snowflakesMobileDetect.php
Line: 1065

==>1065:                   if (is_array($matchType['matches'])) {

I'm using the latest version of Snowflake, smf 2.0.19 and php 7.4

Any idea why?
Thanks
Title: Re: Snowflakes
Post by: Chen Zhen on February 19, 2022, 11:04:44 PM

@petewadey
The null error you were receiving in your log should be fixed for Snowflakes v1.80.

Thanks for the report.
Title: Re: Snowflakes
Post by: JasonSGN on February 21, 2022, 08:58:39 AM
Thanks for the great mod. I installed it on a clean 2.1.1 installation and the snowflakes work fine, but trying to change any settings resulted in a blank screen when saving. The only thing I can think of is that my site is running on PHP 8.x. Could that be the problem? Thanks in advance.
Title: Re: Snowflakes
Post by: Steve on February 21, 2022, 01:54:42 PM
Can you drop your PHP to 7.x and see if you still have the same problem?
Title: Re: Snowflakes
Post by: Arantor on February 21, 2022, 02:32:17 PM
Would love to know what errors are hitting the server (not necessarily SMF's) error log.
Title: Re: Snowflakes
Post by: JasonSGN on February 21, 2022, 03:21:07 PM
Quote from: Steve on February 21, 2022, 01:54:42 PMCan you drop your PHP to 7.x and see if you still have the same problem?
I downgraded to 7.4 and it seems to be working fine now. Thanks. Hopefully it can be updated to support PHP 8.x in the future.
Title: Re: Snowflakes
Post by: Chen Zhen on February 21, 2022, 10:50:41 PM

@JasonSGN :
I updated the mod to version 1.81 which should allow it to function using PHP 8.0.0+.

The changelog shows what was fixed for anyone curious about it.
Title: Re: Snowflakes
Post by: JasonSGN on February 21, 2022, 11:08:53 PM
Thanks. Just tested it with PHP 8.04 and it works perfectly. I appreciate you updating it so quickly.
Title: Re: Snowflakes
Post by: Julius_2000 on November 07, 2022, 07:49:10 AM
Hi there, great mod!

Question: I would like to assign a random opacity value to each flake in Flurry mode to create a little more depth. All I was able to do with my limited knowledge so far was to add this randomization to the jquerySnow01.js file

{op=(Math.random() * (0.99 - 0.75) + 0.75).toFixed(2)};

But it makes the flakes changing opacity indefintely. It looks nice, too, giving them a shimmering effect, but it's not quite what I'd like it to be. Is there a way to get individual opacity for each flake?
Title: Re: Snowflakes
Post by: Chen Zhen on November 10, 2022, 10:38:57 PM
Just use the Math.random() function by itself & add to the JS where it alters the css for the flakes (instead of the op variable).

ie.
f.css('opacity',Math.random());


Title: Re: Snowflakes
Post by: Chen Zhen on November 10, 2022, 10:57:54 PM
To make it affect each flake a bit different you can try this...

find:
f.css('opacity',op);

replace with:
setInterval(flakeOpacity, (Math.floor(Math.random() * 15000) + 2000), f);

Put this at the end of the file:
function flakeOpacity(f) {
    f.css('opacity',Math.random());
}

You can change the random interval to your liking (15000 & 2000 from above).
Title: Re: Snowflakes
Post by: Chen Zhen on November 13, 2022, 05:21:23 PM

IMO for this scenario an interval (repeat) is not necessary & will cause a bit of a performance issue.
A timeout is more suitable for the desired outcome.

Change the above interval function to a timeout:
setTimeout(flakeOpacity, (Math.floor(Math.random() * 15000) + 2000), f);
Title: Re: Snowflakes
Post by: Julius_2000 on November 17, 2022, 03:00:35 PM
Thank you so much for helping out, Zhen! Your solution creates interesting effects but they still flicker.

I'd like to achieve something like this:
https://www.cssscript.com/demo/snow-falling-animation/

The reason I would like to use your mod instead of the one in my link is that yours is a bit more CPU efficient, at least it seems that way.
Title: Re: Snowflakes
Post by: woolly bugger on November 22, 2022, 02:15:49 PM
What happened to the exploding lights, my peeps are missing them...

Title: Re: Snowflakes
Post by: Chen Zhen on November 27, 2022, 11:08:03 PM
@woolly bugger
The "Xmas Lights" option is available which gives you the exploding lights.
Title: Re: snowflakesSMF.php could not be called.
Post by: Michael Vail on December 05, 2022, 02:16:23 PM
I recently upgraded to SMF 2.1.3 and have been receiving the following errors in the log of my forum ever since.

Quote98.97.113.141
 2903a0e006f86daba3fdbaf7970d19a5
 https://www.sonomacountydsa.org/forums/index.php?action=profile;area=alerts_popup;counter=0;u=2  Backtrace information

Type of error: General
Error messageSelect
Hook call: function "smf_snowflakes_profile" in file /home/customer/www/sonomacountydsa.org/public_html/forums/Sources/snowflakesSMF.php could not be called.

I confirmed the snowflakesSMF.php is in the Sources folder so I'm not sure what's happening.

Just wanted you to know in case it was something you wanted to fix.

Thank you and happy holidays.
Title: Re: Snowflakes
Post by: Chen Zhen on December 07, 2022, 08:33:57 PM

@Michael Vail

For the moment I can't seem to duplicate your report.
However, I've only tested this thus far on a patched update of SMF as opposed to a fresh installation.
I've also tried adjusting profile settings as your error URL seems to indicate that there was a problem when doing that but it seems to work fine with snowflakes enabled or disabled (in the user profile).

Can you try uninstalling it & then installing the latest version anew?
Title: Re: Snowflakes
Post by: Michael Vail on December 08, 2022, 11:38:09 PM
Ironically, the problem stopped on its own here too. I have no idea what was causing it other than maybe there was a hosting account problem. Sorry for the trouble but I'm glad it turned out to only be a ghost in the machine.

Thanks for the awesome MOD and Happy Holidays!
Title: Re: Snowflakes
Post by: Viper013 on February 22, 2023, 10:01:23 AM
Hi Chen Zhen,

i have a problem with your mod in SMF 2.1.3.

I use the Option: "XMAS Light Strands" on my Forum at Christmas
With SMF 2.0.19 i have nice colored bigger dots (see xlights_smf-2.0.19.jpg)


With SMF 2.1.3 i just have tiny white dots (see xlights_smf-2.1.3.jpg)
That looks rather odd.

Did you have a idea to fix that ?


Thanks for your help.

Greetings
Steffen
Title: Re: Snowflakes
Post by: Chen Zhen on March 08, 2023, 09:32:31 PM

@Viper013 I apologize for the late reply. I just tested this on SMF 2.1.3 with the default theme & don't see any issue. It could be the theme you're using or a mod somehow affecting the css.
Title: Re: Snowflakes
Post by: Viper013 on March 09, 2023, 03:00:03 AM
Hi Chen Zhen,
thanks for your answer.

I have the default theme and used the "Curve2 Color Changer" Mod
to change some colors (Background,Buttons,etc.)

I tried some other Themes and it works all fine.


It must be something with my own created background-color for the header.


Greetings
Steffen
Title: Re: Snowflakes
Post by: Viper013 on March 09, 2023, 05:02:27 AM

... now i got it.

It was definitly the mod "Curve2 Color Changer".

Now the fun begins.
Trying to find out what the heck this mod affect to the snowflakes. :o
Title: Re: Snowflakes
Post by: Viper013 on March 09, 2023, 11:52:21 AM
Finaly i find it out.  :)

The Mod "Curve2 Color Changer" has a option to remove shadows.
(text-shadow + box-shadow).

When this option is checked, .... the Snowflake-Mod has this strange "XMAS Light Strands" problem.

I change text-shadow options in the index.css to "text-shadow: none !important"
and voila, ... everything works fine.


Title: Re: Snowflakes
Post by: ColinJM on December 08, 2023, 02:44:28 AM
@Chen Zhen  - went to install this on to the default Theme 2.1.4 - downloaded and uploaded the zip file, but when I attempted to install I received a Simple Machines Download Site - Unknown or Not Found
Title: Re: Snowflakes
Post by: Chen Zhen on December 08, 2023, 11:27:05 AM

This mod works fine on SMF 2.1.4 when installed via the SMF package manager.


Title: Re: Snowflakes
Post by: Steve on December 09, 2023, 05:29:53 AM
The mod itself works fine but it does cause a problem with any theme that has a menu bar at the top. It is EXTREMELY difficult to get the cursor in just the right spot so the menu item can be clicked on. And the quick theme changer mod (https://custom.simplemachines.org/index.php?mod=3356) can't be used at all.

I can provide screenshots if you need them.
Title: Re: Snowflakes
Post by: Chen Zhen on December 09, 2023, 09:30:24 AM
There are admin settings to add container id's & classes. The effects will be hidden when the mouse cursor hovers over those containers.

It's difficult to have these included in the code by default since I can't guess what unique id's are going to be used by theme developers.

I can possibly add something that will do that for cursor position (XY coordinates) which I will look into this weekend. In the meantime you can look at the source code of templates via the browser to determine container id's/classes to add to the Snowflakes admin settings.
Title: Re: Snowflakes
Post by: Chen Zhen on December 09, 2023, 01:22:34 PM
Updated to version 1.83 with an option to disable the light effects on a vertical cursor range.
(staring at 1 to a max of 999 from the top of the window)

Note that there are already options to disable light effects on container classes & id's.
There are also options to offset the light scripts so they don't interfere with top navigation.
Admin options will vary when you choose a specific effect within the admin.
Title: Re: Snowflakes
Post by: Steve on December 09, 2023, 03:59:42 PM
Thanks. :)
Title: Re: Snowflakes
Post by: lord alibaski on December 10, 2023, 02:16:17 PM
Quote from: ColinJM on December 08, 2023, 02:44:28 AM@Chen Zhen  - went to install this on to the default Theme 2.1.4 - downloaded and uploaded the zip file, but when I attempted to install I received a Simple Machines Download Site - Unknown or Not Found

I have the same problem. I wanted to add it to the xmas theme by TwitchisMental and wanted to add some snowflakes so I tested it using wamp 1st and it worked perfectly fine. Installed it on a live forum and it does install but is missing from the modification settings but you can see it in package manager.

Title: Re: Snowflakes
Post by: Chen Zhen on December 10, 2023, 06:27:25 PM
Why does it say miscellaneous on your screenshot? Snowflakes does not install under that heading on a regular SMF setup.

Click on the actual modification settings link to bring up mods which should include Snowflakes.

QuoteThis installation process will add options to the mod settings template...
Title: Re: Snowflakes
Post by: lord alibaski on December 10, 2023, 09:52:28 PM
@ Chen

Like I said when I click on Configuration - modification settings it doesn't install but it will install when using wampserver.

Like the attachment below
Title: Re: Snowflakes
Post by: ColinJM on December 11, 2023, 01:53:59 AM
@chen, My apologies - I've now done a correct reinstall - nice mod!  8)
Title: Re: Snowflakes
Post by: Chen Zhen on December 11, 2023, 08:32:23 AM

@ColinJM: No problem.. I'm glad you figured it out & got it working.



@lord alibaski:

I apologize as I forgot the first link for mod settings navigation shows "miscellaneous".
Any mod I've made that uses the generalized mod settings for admin access are on their own beside that link.

I don't know why it's behaving like that as I've never seen that problem.
Does this only occur on that Xmas theme?
Does the drop-down menu show the snowflakes link?

ie.
 
Title: Re: Snowflakes
Post by: Chen Zhen on December 11, 2023, 08:47:15 AM
@lord alibaski:

I noticed you're using SMF 2.1.4 and you appear to have the the "child boards as drop-down" mod installed. As far as I can tell that mod is only compatible with the SMF 2.0 branch.

Did you edit that mod so it will work with SMF 2.1.4?
Is it possible that it is conflicting with the modification settings navigation links?
Title: Re: Snowflakes
Post by: lord alibaski on December 11, 2023, 09:56:01 AM
@ Chen Zhen

After me posting last night I thought to myself was it the drop down mod causing problems, this could be the issue the mod package isn't there anymore but for some strange reason it looks like it stayed installed when I did a full upgrade to SMF 2.1.4 and now I can't remove it, I can disable it but this doesn't fix the issue.

The issue is there on all theme's on my live forum but is completely fine on wampserver so it could definitely be the drop down mod causing the problem, it's not a problem to worry about.
Title: Re: Snowflakes
Post by: Chen Zhen on December 11, 2023, 04:46:13 PM
It sounds like leftover hooks loading & executing files/functions for that mod. You can use SMF maintenance to manually remove those hooks.
Title: Re: Snowflakes
Post by: lord alibaski on December 11, 2023, 06:21:52 PM
Quote from: Chen Zhen on December 11, 2023, 04:46:13 PMIt sounds like leftover hooks loading & executing files/functions for that mod. You can use SMF maintenance to manually remove those hooks.

Just done that but for some reason it still wont install and I have removed all modifications and cleaned all old hooks that were not needed.

Brilliant now I tried to re-install SimpleAudioVideoEmbedder7.0.3 and now I have a HTTP500 error, last time I got this it was a modification parse error but I forgot how to fix it.
Title: Re: Snowflakes
Post by: Chen Zhen on December 11, 2023, 07:52:27 PM
Title: Re: Snowflakes
Post by: lord alibaski on December 11, 2023, 09:11:23 PM
Just done all that and I still having problems re-installing SimpleAudioVideoEmbedder7.0.3 I will see what vb says about it.