Page 7 of 7

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Fri 03 Jan 2025 6:08 pm
by surban21
@lse-cumulus, @Dador and others who may be interested. I've been working on a version for CMX 4.3+ and am nearing completion (I hope). I've modified the appearance and of course in the middle of testing. I've added the ability to select a language and convert all the text on the webpage to the selected language. There are a few other areas I've been working on but it seems to be close to being finished. At least for the initial roll out. Anyway, I'm including a pic so you can get an idea of what's taking place (using test data). I appreciate your patience and @lse-cumulus thank you for what you have been doing to try keep the old version working.

lse-cumulus, you are correct. I had to choose how i wanted to use the depth input box on the previous version and I felt it was more important to record new falling snow. In the old version this field was named snowDepth. But now, in this new diary.db structure, snowDepth is still retained (where the values were stored if you followed my way of using the old version) and a new diary.db field named snow24h - for new snowfall. I guess what I'm trying to say is that all the entries stored from my previous snowSummary now has to be moved over to the snow24h column (field). I'm still working on a streamline way of doing this, or a person could just re-enter everything by hand. I used a sql statement to move the data from snowDepth to snow24h and replaced all the snowDepth cells with null. Anyhow, I'd be open to suggestions on how to move this data to the new snow24h field less painful.

Screenshot_new_snowfall_data.png

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Fri 03 Jan 2025 7:11 pm
by PaulMy
Hi Steve,
Seems like I abandoned this in 2023 viewtopic.php?p=169003#p169003
and would give it another try if I can. The latest download I have is SnowSummary_v_1_1.zip. What is the best way to start again?

Enjoy,
Paul

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Fri 03 Jan 2025 7:23 pm
by surban21
@PaulMy - there isn't at this moment. I'm finishing, cleaning and testing the new version for CMX 4.3+. When ready, I'll probably place it in a new thread and have basic instructions. When that time comes, let me know if you're still interested in trying to set it up and I'll help as much as I can.

I just posted this pic to keep those that used the previous snowSummary script up to date on my intentions. Thanks Pauly. (as you can surmise, your excel sheet was very much my inspiration).

adpated php script snowSumData.php for CMX 4.3.2 diary.db via sqlite VIEW

Posted: Sun 05 Jan 2025 9:54 am
by lse-cumulus
I tested succesfully with CMX 4.3.2 build 4067 and modified php script snowSumData.php v1.2 by replacing table name DiaryData by View name VDiaryData;
After the CMX migration of diary.db that took over the SnowDepth values, I adapted the DiaryData via CMX admin interface Weather Diary Editor to fill out also the Snow24h values (based on my comments in the historical data).
The links (as standalone page and out from CU) show real snow data from my PWS (and no test data) https://leonas.ddns.net/Wetterstation.S ... ummary.php,
https://leonas.ddns.net/Wetterstation.S ... ummary.txt

My modified version of snowSumData.php v1.2 that works with CMX 4.3.2 and the new diary.db format (after you created the view that is outlined in the header comment of the script) and also works with older PHP 5.3.27 and sqllite 3.7.7.1 can be found in the attachment in a previous post of mine in this topic-thread.

Re: PHP script to display monthly/yearly snow depth totals from diary.db

Posted: Mon 06 Jan 2025 9:11 pm
by surban21
Very nice work @lse-cumulus. I'll have to play around with it. Thank you for your dedication to this!

I have released an updated version for use with CMX 4.3 and above. If anybody is interested it can be found here:
viewtopic.php?t=22921