phpDivingLog 3.0 Development

3rd party extensions (phpDivingLog, dive computer downloader,...)
lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

G'day Rob,

Thanks for the fix and for the merge.

As best as I can tell the dependencies for phpDivingLog v2.2 are:

JpGraph v1.22 and v2.3.3 (http://jpgraph.net/)
v1.27 and v3.5 now available

phpMyDatagrid v2007a (http://www.gurusistemas.com/indexdatagrid.php)
Seems to be still the latest free version.

SmartyHost v2.6.18 (http://www.smarty.net/)
v2.6.26 and 3.0.8 now available

RTFClass v155 (http://www.phpclasses.org/browse/file/7632.html)
Rich Text Format - Parsing Class - (c) 2000 Markus Fischer
No update available

PEAR packages:
MDB2 v1.318
Pager v1.26

Highlide JS v4.1.4 (http://highslide.com/support)
Used to overlay dive pictures on the current page.
v4.1.12 now available

Lightbox JS v2.0 (http://www.huddletogether.com/projects/lightbox2/)
No longer used to overlay dive pictures on the current page.
Replaced by Highslide JS.


Have I missed any?

Any advice as to which you'd update and which you'd leave as is?

I usually find it helps to install the latest versions of most dependencies before starting development of a new version.

Best Regards, Lloyd Borrett

Inferno
Posts: 252
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Re: phpDivingLog 3.0 Development

Post by Inferno »

lloyd_borrett wrote:G'day Rob,
JpGraph v1.22 and v2.3.3 (http://jpgraph.net/)
v1.27 and v3.5 now available
Upgraded yesterday to Jpgraph 3.5
See the result here: http://rob.lensen.nu/divelog_git/index.php/142
Had to do some changes to the graph code, thing which I don't get to work is setting the grid in front. This isn't working in the Jpgraph example code as well. So look like bug in Jpgraph

[quote[SmartyHost v2.6.18 (http://www.smarty.net/)
v2.6.26 and 3.0.8 now available
[/quote]
This was my next thing to upgrade
PEAR packages:
MDB2 v1.318
Pager v1.26
Will upgrade them as well
Highlide JS v4.1.4 (http://highslide.com/support)
Used to overlay dive pictures on the current page.
v4.1.12 now available
Upgrade done
Lightbox JS v2.0 (http://www.huddletogether.com/projects/lightbox2/)
No longer used to overlay dive pictures on the current page.
Replaced by Highslide JS.

Have I missed any?

Any advice as to which you'd update and which you'd leave as is?

I usually find it helps to install the latest versions of most dependencies before starting development of a new version.
So I'm planning to update most dependecies and make the code base somewhat smaller by saying we just support PHP5.1>

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

G'day Sven,

I'm now trying to add some of the new fields and features to phpDivingLog. Would you please be able to help me out with the following items?

Icons
Any chance you could supply me with the image icons (gif, jpg, png) that you're using for:
Dive Profile, Single and Twin Cylinders, Ratings
Google Maps, Google Earth, Bing, GPS
Gas mixtures (Air, N32, N36, Tri, O2, HE, AR)
If you don't already have these to hand in separate files, just let me know and I'll capture them myself.

Field Descriptions
Also, could you please explain what the "Aquatic Name" field on Page 2 of Dive Site Details is for? Just what sort of values/descriptions do you think should be going there?

Plus, how do you invisage the "Difficulty" field on Page 2 of Dive Site Details being used? Are you expecting people to just put in their own descriptions, or are they expected to create their own, or use an existing, classification system?

Best Regards, Lloyd Borrett.

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

I now have the additional details for the Dive Sites and Dive Equipment pages working.

The changes I'd already made add most of the extra details for the Dive Statistics pages.

Next will be to start on the actual Logbook pages. Yes, I've been putting off the hard part till last!

Best Regards, Lloyd Borrett.

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

G'day,

I now have most of the additional information now being displayed for the logbook page. This includes the information about the gas being used and the cylinder(s) in use from the logbook table.

I haven't yet looked at how to display the details for addition cylinders for a dive. I need to figure out what is being stored where.

Would I be right in thinking that the details about the primary/back cylinder(s) and gas are in the logbook table, and that the details stored in the tanks table are those for any additional cylinders being used on the dive?

Best Regards, Lloyd Borrett.

divinglog
Site Admin
Posts: 5174
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: phpDivingLog 3.0 Development

Post by divinglog »

Hi Lloyd
lloyd_borrett wrote:Any chance you could supply me with the image icons (gif, jpg, png) that you're using for:
I'm sorry for the late response, I'm currently on a short vacation. I'll send you the icons when I'm back on Monday.
lloyd_borrett wrote:Would I be right in thinking that the details about the primary/back cylinder(s) and gas are in the logbook table, and that the details stored in the tanks table are those for any additional cylinders being used on the dive?
Yes, that's right. The first (default) tank is in the logbook table and has the same data field names as the other (max. 9) tanks in the tank table. So a dive can have max. 10 tanks.
lloyd_borrett wrote:Also, could you please explain what the "Aquatic Name" field on Page 2 of Dive Site Details is for? Just what sort of values/descriptions do you think should be going there?
It's the name of the lake or sea, e.g. Atlantic or Red Sea.
lloyd_borrett wrote:Plus, how do you invisage the "Difficulty" field on Page 2 of Dive Site Details being used? Are you expecting people to just put in their own descriptions, or are they expected to create their own, or use an existing, classification system?
It's a free text field, so users can enter whatever they want.

Best regards,
Sven

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

G'day,

Some more progress has been made.

phpDivingLog v3.0-alpha2 - 2011-08-01 - Lloyd Borrett
* Added ability to display lots of additional values
* on the dive details, dive sites and dive equipment pages
* Added ability to show visibilty type as a set of images
* Added ability to show the dive site ratings as a set of images
* Added images to show if single or twin cylinders being used
* Added images to show if supply type is OC, SCR or CCR
* Added default values for maxPPO2, O2 and datum
* Added in calculated values for MOD, EAD and exit time
* Added in display of an image for the back gas type
* Fixed some formatting issues

Rob Lensen is updating various dependencies. He's also looking at helping with turning the section I’ve now got for displaying the tank and gas details from the logbook table, into also showing the same details for any other cylinders for the dive in the tank table.

Things still on the to-do list include:
  • Add in code to get and display appropriate details from the shop and trip tables.
  • Show the Exif Data for photos, but I’m not sure about where it should go.
  • Show the user-defined fields. If people have gone to the trouble to use them, then they’d probably like to see them displayed.
  • Add a temperature chart if the data is available. Also show the gas switches on the dive profile, plus add a chart to show the gas changes.
  • Add charts for the Asc-/Descend rate, tank pressures and ppO2 (because my dive computer supports these). I guess others will want the most of other chart types as well.
  • Put various parts of the dive details onto separate tabs, sort of like the way Diving Log does. It’s getting too long and detailed as it is and there's still much more to come.
  • Show inactive equipment separately in the equipment list.
  • Show which equipment items are due for service.


I’m not keen to add in support for displaying the signatures. I think there are too many privacy concerns. That’s why I’ve also never added in a way to show the full details from the buddy table.

I've set up a temporary development version on my web site so as to be able to check for any issues with it in a hosted environment. See http://www.borrett.id.au/divelog3/index.php?view=list to take a look at how it's coming along. But if you go there and it's broken or missing, then you'll know why.

Comments, feedback and suggestions are all most welcome.

Best Regards, Lloyd Borrett.

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

G'day,

So far this week most of the effort has been around coming to grips with Github, and merging my phpDivingLog 3 development version with the changes Rob Lensen has made to his phpDivingLog 3. Rob had updated some dependencies, plus moved the location of some code and made other changes. Once I did a merge of his code with mine, a heap of things stopped working, like the dive profile graph, dive stats pie chart, the equipment listing and viewing photos. Hopefully we'll be able to work out why soon enough and move forward again.

Rob is looking to move to a different charting component because of problems and limitations with the current one. He suggested pGraph. I've just put it onto my setup and the charts it produces look stunning. But it will take a while to get it working with phpDivingLog 3.

I did get the use of tabs on the dive details and dive statistics pages working. Having tabs makes the information way more accessible.

I think I've also fixed the caluculation of tank capacity when in imperial values mode. It now takes into account the working pressure of the tank if its available.

I've also been spending some time adding in extra information to my actual Diving Log. The focus is in having data in most of the new fields so that I can test how they work with phpDivingLog 3.

Best Regards, Lloyd Borrett.

divinglog
Site Admin
Posts: 5174
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: phpDivingLog 3.0 Development

Post by divinglog »

Hi Lloyd

Do you still need the icons or have you extracted them already?

Cheers,
Sven

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

divinglog wrote:Do you still need the icons or have you extracted them already?
I think I've now extracted all I need.

Best Regards, Lloyd Borrett.

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

G'day,

I managed to make some progress on phpDivingLog 3 while on a dive holiday in the Galapagos Islands for the past two weeks. You can see an example dive with multiple cylinder sets in use here - http://www.borrett.id.au/divelog3/index.php?id=290

phpDivingLog v3.0-alpha3 - 2011-08-24 - Lloyd Borrett and Rob Lensen
* Added tabs to dive details and dive statistics pages
* Modified the calculation of imperial cylinder size to use working pressure if available
* Added Active to equipment overview listing
* Fixed formatting issues
* Fixed some bugs
* Added TODO file so we have an overview what has to be done
* Changed the parse_mysql query function so if just one result is there don't create an array
* Added the Divesite name to the gallery
* Added EXIF information to the dive photos
* Added display of dive shops/centres and trips/vacations
* Made URLs and email addresses in dive/site/equipment/shop/trip comments clickable
* Added display of cylinder and supply type statistics
* Added display of multiple cylinder sets to dive details breathing tab
* Added calculation of END for Trimix dives

Things still to do include:
* Get average depth and sac for multiple dive tank sets working
* Display related info from other tables in dive details (i.e. shops, trips etc.)
* Display of overview and details pages for country and city
* Extra profile charts (e.g. temperature, gas changes, Asc-/Descend rate, tank pressures, ppO2 etc.)
* Extra dive statistics (e.g. charts as per Diving Log)
* Improvements to the photo gallery
* Show which equipment items are due for service and/or O2 clean
* Show the user-defined fields
* Protected access to overview and details of buddies
* Get a better RTF to HTML converter to fully support the RTF markup Diving Log can do

Currently working on adding the display of dive countries.

Sven: I could use some help with getting the average depth and SAC rates right for the overall dive, plus for each cylinder set. If you could explain how this is being done in Diving Log 5, then we can try and do the same in phpDivingLog 3.

Best Regards, Lloyd Borrett.

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

Are there any MySQL gurus out there who could help me put together a query?

We have a Country table with ID and Country.
We have a Logbook table with one record per dive and CountryID.

I need a MySQL query that will return a list of the countries in the Country table, with a count of the matching number of dives in the Logbook table.

UPDATED

Worked it out.

SELECT c.ID, c.Country, COUNT(*)
FROM $_config[table_prefix]Country AS c, $_config[table_prefix]Logbook AS l
WHERE c.ID = l.CountryID
GROUP BY l.CountryID
ORDER BY c.Country ASC
Last edited by lloyd_borrett on Sat Aug 27, 2011 20:07, edited 1 time in total.

divinglog
Site Admin
Posts: 5174
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: phpDivingLog 3.0 Development

Post by divinglog »

Hi Lloyd

Great work, it's looking really awesome!
We have a Country table with ID and Country.
We have a Logbook table with one record per dive and CountryID.

I need a MySQL query that will return a list of the countries in the Country table, with a count of the matching number of dives in the Logbook table.
This should do the trick for only linked countries:

Code: Select all

SELECT Country.Country, Count(Logbook.CountryID) AS DiveCount FROM Logbook INNER JOIN Country ON Logbook.CountryID = Country.ID GROUP BY Country.Country
And this for all Countries:

Code: Select all

SELECT Logbook.Country, Count(Logbook.Country) AS DiveCount FROM Logbook GROUP BY Logbook.Country
Sven: I could use some help with getting the average depth and SAC rates right for the overall dive, plus for each cylinder set. If you could explain how this is being done in Diving Log 5, then we can try and do the same in phpDivingLog 3.
I've explained that a bit in that blog post. Basically I run a loop over each profile sample and look at the tank ID. I calculate for each tank ID the average depth the the dive time for that tank. Then I can calculate for each tank the SAC rate and then the average for the overall dive. I got feedback from a user that the last step is not completely correct and that there is a better calculation which takes the time for each tank into account. But for now you can use the simple calculation to get the average SAC for all tanks.

lloyd_borrett
Posts: 228
Joined: Sun Jun 11, 2006 09:24
Location: Frankston South, Victoria, Australia
Contact:

Re: phpDivingLog 3.0 Development

Post by lloyd_borrett »

G'day,

I need help with another tricky MySQL query.

I want to get the Place ID and Place name for all dive sites for a given country ID. But it seems the CountryID in the Place table isn't actually used.

But there must be some way to make the connection (possibly via the Logbook table).

Best Regards, Lloyd Borrett.

divinglog
Site Admin
Posts: 5174
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: phpDivingLog 3.0 Development

Post by divinglog »

There are 2 ways, the result should be the same:

Code: Select all

SELECT Logbook.Place, Logbook.PlaceID FROM Logbook WHERE Logbook.CountryID=1 AND Logbook.PlaceID Is Not Null

Code: Select all

SELECT Place.Place, Place.ID FROM Logbook INNER JOIN Place ON Logbook.PlaceID = Place.ID WHERE Logbook.CountryID=1;

Post Reply