phpDivingLog

3rd party extensions (phpDivingLog, dive computer downloader,...)
Post Reply
mhedstrom
Posts: 46
Joined: Wed Jun 06, 2007 23:21

Post by mhedstrom »

Is it possible to make a mysql dump, since I found a bug in the export query of divinglog, where the divesite_id is not set in the Logbook table. If that is the case divesites will be empty
Ah I see, in the dive list screen you're getting the dive location directly from the logbook, and in the individual dive screen, I'm assuming then you're trying to get the dive location by using the location ID number stored in the logbook which indexes into the Place table?

Yes, that would be the problem then. I did notice last night that none of the ID numbers for my countries, places, or Cities were set. I was planning on posting in the General forum asking about that, but from what you said, it's a known bug anyways.
Which version of mysql you have got? I will fix the query's anyway
We're using 4.0.18. I can probably upgrade to 4.1 or later when I have the time.
Also I can fix the CSS myself, but everything is butted up right against the left margin.

It is just Firefox I think IE looks ok
It's in Safari too, that's what I'm using. Using Safari has other issues though (like you can't sort the columns), but I don't necessarily consider that a big deal since I'm using Safari.
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Post by Inferno »

mhedstrom wrote:Ah I see, in the dive list screen you're getting the dive location directly from the logbook, and in the individual dive screen, I'm assuming then you're trying to get the dive location by using the location ID number stored in the logbook which indexes into the Place table?
Yes that's true
If the location is not blue colored in Divinglog no divesite id is set in the logbook table don't know why this is
We're using 4.0.18. I can probably upgrade to 4.1 or later when I have the time.
Ok so it looks that 4.1 is less strict in the query's. I fixed the sql statements
It's in Safari too, that's what I'm using. Using Safari has other issues though (like you can't sort the columns), but I don't necessarily consider that a big deal since I'm using Safari.
Should be possible since phpmydatagrid is W3C complient. I will test it with konqueror should be quite similair to safari.

In my opionon divinglog should work on all browsers, otherwise the html is not ok. Maybe I don't fix things for stupid IE css bugs....
divinglog
Site Admin
Posts: 5768
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Post by divinglog »

If the location is not blue colored in Divinglog no divesite id is set in the logbook table don't know why this is
There are 2 ways in Diving Log for entering the location information. The easier way is to simply enter a text string into the dropdown fields of the logbook window or to choose one from the dropdown list. In this case no ID is set and the dive is not linked with detail data, the text string is saved directly in the logbook table.

The other way is to link a dive with detail data by clicking the info icon above the dropdown. In this case the ID is set and can be exported and additional the text string is also set in the logbook database and the text is colored blue.

I know this is a little bit confusing from database design, but I want to keep this design so that nobody is forced to enter for each entry the detailed data.
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Post by Inferno »

divinglog wrote:The other way is to link a dive with detail data by clicking the info icon above the dropdown. In this case the ID is set and can be exported and additional the text string is also set in the logbook database and the text is colored blue.

I know this is a little bit confusing from database design, but I want to keep this design so that nobody is forced to enter for each entry the detailed data.
We have to think how we implemented this in phpDivinglog

In my opinion we have to make FAQ for this, since we can't solve this problem for phpDivinglog

Other opinions?
mhedstrom
Posts: 46
Joined: Wed Jun 06, 2007 23:21

Post by mhedstrom »

I posted on the general forum because I didn't realize he had posted here, but ideally I'd like to see a preference where you can link the drop-down box to what's listed in details. It's pretty confusing that the 2 aren't linked. However barring that, definitely make it very clear in the FAQ that they aren't linked and if you want the IDs you need to do the Details screen thing.

Also while I'm posting, I managed to fix 7 of my dives so far, and 5 of those 7 have the same dive site. In the Dive Sites screen of phpdivinglog, I'm seeing that site listed 5 times, and all of the 5 links go the same place. See http://cosmo.ogre.com/divelog/divesite.php/1/list if you need an example.
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Post by Inferno »

mhedstrom wrote:I posted on the general forum because I didn't realize he had posted here, but ideally I'd like to see a preference where you can link the drop-down box to what's listed in details. It's pretty confusing that the 2 aren't linked. However barring that, definitely make it very clear in the FAQ that they aren't linked and if you want the IDs you need to do the Details screen thing.
agreed
Also while I'm posting, I managed to fix 7 of my dives so far, and 5 of those 7 have the same dive site. In the Dive Sites screen of phpdivinglog, I'm seeing that site listed 5 times, and all of the 5 links go the same place. See http://cosmo.ogre.com/divelog/divesite.php/1/list if you need an example.
That is really strange, look in mysql looks if there are more unique identifiers in the DB
mhedstrom
Posts: 46
Joined: Wed Jun 06, 2007 23:21

Post by mhedstrom »

That is really strange, look in mysql looks if there are more unique identifiers in the DB
Looking at the michellePlaces table, there are 13 unique sites listed, which is correct since I've dove at 13 different sites.

I created a workaround for the metric->imperial problem too in the dive overview stuff, which works for the table view, at least. I created a new mysql query in the sql directory and called it "recentdivelist-imp.sql" which looks like:

Code: Select all

SELECT      Number,
                Divedate,
                Divetime,
                ROUND(Depth*3.2808,1) as Depth,
                Place,
                City
 FROM           $_config[table_prefix]Logbook
 ORDER BY Number DESC
then in the classes.inc.php file, in the get_dive_overview_table function, I do this:

Code: Select all

 if ($_config['length'])
            $recentdivelist_query = sql_file('recentdivelist-imp.sql');
        else
            $recentdivelist_query = sql_file('recentdivelist.sql');
and then set the appropriate "ft" or "m" further down much the same way.

Probably not an ideal solution, but it works. :)
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Post by Inferno »

All problems mentioned here are fixed in the new version

http://rob.lensen.nu/dev/phpDivinglog-2.0a4.tar.gz

(again the kiss version)
- Fixed the statistics page does not link to correct dives in multi user mode
- Fixes in the conversion to feet
- Language file fix
- Added query for imp request
- Center page in firefox
- In the Divesite query I added GROUP BY ID should solve the duplicated id's
- Fix the query's from the divestats page do not work in Mysql 4.0

See diff
http://rob.lensen.nu/WebSVN/comp.php?re ... e[]=%2F@72
mhedstrom
Posts: 46
Joined: Wed Jun 06, 2007 23:21

Post by mhedstrom »

Thanks for the quick bug fixes! All the stuff I reported before works great, and thanks for using my idea - at least I feel like I contribute a bit now. :)

Small bug: the SAC rate on the individual dive page still says "cu ft/min". :)

Dive profiles aren't being drawn for me now in the individual dives. Here are the errors and stack traces. The first two seem to come up whenever I go to an individual dive, and is probably what's making the dive profiles not work. The second two actually occur when I click on the "Dive Sites" link. The link works, but I get these errors in the error log.

[Wed Oct 3 08:06:30 2007] [error] PHP Stack trace:
[Wed Oct 3 08:06:30 2007] [error] PHP 1. {main}() /server/html/divelog/index.php:0
[Wed Oct 3 08:06:30 2007] [error] PHP 2. divelog->set_breathing_details() /server/html/divelog/index.php:73
[Wed Oct 3 08:06:30 2007] [error] PHP Notice: Undefined offset: -1 in /server/html/divelog/classes.inc.php on line 908

AND

[Wed Oct 3 08:06:31 2007] [error] PHP Stack trace:
[Wed Oct 3 08:06:31 2007] [error] PHP 1. {main}() /server/html/divelog/drawprofile.php:0
[Wed Oct 3 08:06:31 2007] [error] PHP 2. include_once() /server/html/divelog/drawprofile.php:31
[Wed Oct 3 08:06:31 2007] [error] PHP 3. require_once() /server/html/divelog/includes/jpgraph/src/jpgraph.php:180
[Wed Oct 3 08:06:31 2007] [error] PHP Fatal error: Cannot redeclare class gradient in /server/html/divelog/includes/jpgraph/src/jpgraph_gradient.php on line 32

------
[Wed Oct 3 08:16:59 2007] [error] PHP Stack trace:
[Wed Oct 3 08:16:59 2007] [error] PHP 1. {main}() /server/html/divelog/divesite.php:0
[Wed Oct 3 08:16:59 2007] [error] PHP 2. divesite->get_divesite_overview() /server/html/divelog/divesite.php:66
[Wed Oct 3 08:16:59 2007] [error] PHP 3. divesite->get_divesite_overview_table() /server/html/divelog/classes.inc.php:1537
[Wed Oct 3 08:16:59 2007] [error] PHP Notice: Undefined property: requested_page in /server/html/divelog/classes.inc.php on line 1567

[Wed Oct 3 08:16:59 2007] [error] PHP Stack trace:
[Wed Oct 3 08:16:59 2007] [error] PHP 1. {main}() /server/html/divelog/divesite.php:0
[Wed Oct 3 08:16:59 2007] [error] PHP 2. divesite->get_divesite_overview() /server/html/divelog/divesite.php:66
[Wed Oct 3 08:16:59 2007] [error] PHP 3. divesite->get_divesite_overview_table() /server/html/divelog/classes.inc.php:1537
[Wed Oct 3 08:16:59 2007] [error] PHP 4. pager_wrapper_mdb2() /server/html/divelog/classes.inc.php:1571
[Wed Oct 3 08:16:59 2007] [error] PHP Notice: Only variables should be assigned by reference in /server/html/divelog/pear/Pager_Wrapper.php on line 209
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Post by Inferno »

mhedstrom wrote:Small bug: the SAC rate on the individual dive page still says "cu ft/min". :)
Did not see that one, fixed
Dive profiles aren't being drawn for me now in the individual dives. ....

[Wed Oct 3 08:06:30 2007] [error] PHP Stack trace:
[Wed Oct 3 08:06:30 2007] [error] PHP 1. {main}() /server/html/divelog/index.php:0
[Wed Oct 3 08:06:30 2007] [error] PHP 2. divelog->set_breathing_details() /server/html/divelog/index.php:73
[Wed Oct 3 08:06:30 2007] [error] PHP Notice: Undefined offset: -1 in /server/html/divelog/classes.inc.php on line 908

AND

[Wed Oct 3 08:06:31 2007] [error] PHP Stack trace:
[Wed Oct 3 08:06:31 2007] [error] PHP 1. {main}() /server/html/divelog/drawprofile.php:0
[Wed Oct 3 08:06:31 2007] [error] PHP 2. include_once() /server/html/divelog/drawprofile.php:31
[Wed Oct 3 08:06:31 2007] [error] PHP 3. require_once() /server/html/divelog/includes/jpgraph/src/jpgraph.php:180
[Wed Oct 3 08:06:31 2007] [error] PHP Fatal error: Cannot redeclare class gradient in /server/html/divelog/includes/jpgraph/src/jpgraph_gradient.php on line 32
Will look into the errors the error about the redeclaration is strange since I had that error as well, and solved it by changing the order of includes

Will for it again
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Post by Inferno »

Ok a new version again

http://rob.lensen.nu/dev/phpDivinglog-2.0a5.tar.gz

Try to fix the problems noted
- Fixes some errors of class vars not set
- Try fix profile not shown
- Language fix, remove of &nbsp
mhedstrom
Posts: 46
Joined: Wed Jun 06, 2007 23:21

Post by mhedstrom »

Dive profile graphs still aren't showing up. They did show up in the 2.0a3 version.

[Wed Oct 3 13:46:53 2007] [error] PHP Stack trace:
[Wed Oct 3 13:46:53 2007] [error] PHP 1. {main}() /server/html/divelog/index.php:0
[Wed Oct 3 13:46:53 2007] [error] PHP 2. divelog->set_breathing_details() /server/html/divelog/index.php:73
[Wed Oct 3 13:46:53 2007] [error] PHP Notice: Undefined offset: -1 in /server/html/divelog/classes.inc.php on line 912

[Wed Oct 3 13:46:53 2007] [error] PHP Stack trace:
[Wed Oct 3 13:46:53 2007] [error] PHP 1. {main}() /server/html/divelog/drawprofile.php:0
[Wed Oct 3 13:46:53 2007] [error] PHP Fatal error: Cannot instantiate non-existent class: graph in /server/html/divelog/drawprofile.php on line 153
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Post by Inferno »

mhedstrom wrote:Dive profile graphs still aren't showing up. They did show up in the 2.0a3 version.

[Wed Oct 3 13:46:53 2007] [error] PHP Stack trace:
[Wed Oct 3 13:46:53 2007] [error] PHP 1. {main}() /server/html/divelog/drawprofile.php:0
[Wed Oct 3 13:46:53 2007] [error] PHP Fatal error: Cannot instantiate non-existent class: graph in /server/html/divelog/drawprofile.php on line 153
I don't get this one
Which php version do you use?
mhedstrom
Posts: 46
Joined: Wed Jun 06, 2007 23:21

Post by mhedstrom »

Inferno wrote: I don't get this one
Which php version do you use?
4.4.2. We can't upgrade to 5 right now because we have a bunch of stuff running that'll break pretty bad, and don't have the time now.
Inferno
Posts: 264
Joined: Thu Apr 19, 2007 20:36
Location: The Netherlands
Contact:

Post by Inferno »

mhedstrom wrote:
Inferno wrote: I don't get this one
Which php version do you use?
4.4.2. We can't upgrade to 5 right now because we have a bunch of stuff running that'll break pretty bad, and don't have the time now.
My fault, forgot to merge changes in my working config.inc.php with version in SVN (my passwords should not be in SVN)

http://rob.lensen.nu/dev/phpDivinglog-2.0a6.tar.gz
Post Reply