phpDivingLog

3rd party extensions (phpDivingLog, dive computer downloader,...)
Post Reply
Sebas
Posts: 9
Joined: Thu Oct 05, 2006 14:45
Location: Deventer, The Netherlands
Contact:

Post by Sebas » Thu Oct 05, 2006 14:52

Hi,

Wanted to let you know that I've created a Wordpress plug-in for integration of phpdivinglog with Wordpress. An example is avaiable here and more information about the plugin is available here.

After searching for decent software for keeping my divelog on my computer and website I came across Divinglog and phpDivinglog. It just missed integration with my website which uses Wordpress so I wrote a plugin for it. I hope you like it.

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

Post by lloyd_borrett » Fri Oct 06, 2006 00:32

Well done Sebastian.

I noticed two things.

First, you're using RTF comments, so they aren't displaying well. But don't be too concerned. You could just add some code to skip around the comments in index.php.

Sven tells me that for the next version of Diving Log, he will provide us with the ability to convert RTF comments automatically to text as a part of the MySQL Dump option.

Sven is also looking at an option for us to upload the MySQL Dump data to our online database.

Second, you haven't implemented the Lightbox JS option so that all of the dive pictures can be seen.

I'm considering a few ways to improve the handling of images. Having only just recently started using my underwater camera, I'm now finding that I want to put quite a few pics online for each dive. The Lightbox JS way of looking at them isn't well suited to large numbers of pics though. So I'm going to look at some options to maybe include a thumbnail view of the pics so that people can choose the ones they want to see.

If you, or anyone else, has any ideas for this, I would certainly welcome them.

Best Regards, Lloyd Borrett.

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

Post by divinglog » Fri Oct 06, 2006 07:36

Hello Sebastiaan

Great work! :)
I have linked your website on the Online Logbook Website and will also add it to the tutorial website, I'm writing at the moment.

Sebas
Posts: 9
Joined: Thu Oct 05, 2006 14:45
Location: Deventer, The Netherlands
Contact:

Post by Sebas » Fri Oct 06, 2006 12:21

Hi,

Good that you like the plugin :D Work still has to be done on it. I'll have the installation instructions online tonight.

I've added the lightbox function now. It's something I've accidently deleted from the header.tpl when experimenting with the correct layout. The problem with lightbox and an iframe is that now my pictures aren't showing that well.

About showing pictures with each dive. Maybe it's better to use SimpleViewer which opens in a new window when you click on the pictures link. You can do this using some javascript so a smaller browserwindow opens with no navigation. There are several ways of managing SimpleViewer but basically it's just a flash movie searching for pictures in a directory and showing that. There must be a way to easyly implement that in phpDivingLog. Also try SimpleViewerAdmin for managing simpleviewer.

When you want to add a lot of pictures you'd be better of using Gallery2. It's a complete photo and video gallery script. I use it on my website as well. It has easier upload functions and it's fully customizable and has slideshow functions etc. You can link an album to a dive and then open that album in a new window with no navigation and such.

Are you open to any suggestions about some code adjustments of the phpDivingLog. It would be of great help to me for integrating it into Wordpress when you put all the html code that you now echo into a variable. I can then take that variable and echo / print() it myself. That way there's no need for an iframe anymore. Maybe in the next update.

For example:

Code: Select all

echo " <tr>\n  <td colspan=\"4\" class=\"spacing\">&nbsp;</td>\n </tr>\n";

// Show Dive Information

//	Show main dive details
	echo " <tr class=\"divetitle\">\n";
	echo "  <td width=\"25%\">". $_lang['logbook_divedate'] ."</td>\n";
	echo "  <td width=\"25%\">". $_lang['logbook_entrytime'] ."</td>\n";
	echo "  <td width=\"25%\">". $_lang['logbook_divetime'] ."</td>\n";
	echo "  <td width=\"25%\">". $_lang['logbook_depth'] ."</td>\n";
	echo " </tr>\n";

	echo " <tr class=\"divecontent\">\n";
	if ($result[0]['Divedate'] == "") {
		echo "  <td>-</td>\n";
	} else {
		echo "  <td>". date($_lang['logbook_divedate_format'], strtotime($result[0]['Divedate'])) ."</td>\n";
	}
	if ($result[0]['Entrytime'] == "") {
		echo "  <td>-</td>\n";
	} else {
		echo "  <td>". $result[0]['Entrytime'] ."</td>\n";
	}
Would be:

Code: Select all

$log_content =  ." <tr>\n  <td colspan=\"4\" class=\"spacing\">&nbsp;</td>\n </tr>\n";

// Show Dive Information

//	Show main dive details
$log_content =  . " <tr class=\"divetitle\">\n";
$log_content =  ."  <td width=\"25%\">". $_lang['logbook_divedate'] ."</td>\n";
$log_content =  ."  <td width=\"25%\">". $_lang['logbook_entrytime'] ."</td>\n";
$log_content =  ."  <td width=\"25%\">". $_lang['logbook_divetime'] ."</td>\n";
$log_content =  ."  <td width=\"25%\">". $_lang['logbook_depth'] ."</td>\n";
$log_content =  ." </tr>\n";

$log_content =  ." <tr class=\"divecontent\">\n";
	if ($result[0]['Divedate'] == "") {
$log_content =  ."  <td>-</td>\n";
	} else {
$log_content =  ."  <td>". date($_lang['logbook_divedate_format'], strtotime($result[0]['Divedate'])) ."</td>\n";
	}
	if ($result[0]['Entrytime'] == "") {
$log_content =  ."  <td>-</td>\n";
	} else {
$log_content =  ."  <td>". $result[0]['Entrytime'] ."</td>\n";
	}
	
print("$log_content");
You do that already with $links. That way I can include your php file and print the $log_content. That would also make it possible to make a shorter version of the logbook entry to include in a blog entry.

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

Post by lloyd_borrett » Fri Oct 06, 2006 22:04

Sure I can look at doing that.

Maybe it's about time to consider putting phpDivingLog up into somewhere like SourceForge so that a few of us can collaborate on enhancing it. Anyone interested in being a part of such a development group?

Best Regards, Lloyd Borrett.

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

Post by divinglog » Sat Oct 07, 2006 11:41

Hi Lloyd

I have also a suggestion: Is it possible to put the color definitions for the dive profile into the config file, so I don't have to search the in the graph drawing function?

And one more thing: I want to add an optional table name prefix in the next version of Diving Log. This is better when other scripts share the same database on the webserver. So if the user enters "Dlog" as Prefix, the table names would be DlogBrevets, DlogBuddies and so on.

It would be great if you can add in the config file a setting for an optional table prefix (leave it empty as default).

Edit to add: The direct MySQL upload is finish and will be part of the next update. Now publishing your dives on the web is only one mouse click 8)

Sven

Sebas
Posts: 9
Joined: Thu Oct 05, 2006 14:45
Location: Deventer, The Netherlands
Contact:

Post by Sebas » Sat Oct 07, 2006 20:07

Maybe it's about time to consider putting phpDivingLog up into somewhere like SourceForge so that a few of us can collaborate on enhancing it. Anyone interested in being a part of such a development group?
Yeah sure, I'd be gladd to help with it. It would also be helpfull that I can get the newest versions before they are released so I can check if the plugin works. Just let me know. :)
Edit to add: The direct MySQL upload is finish and will be part of the next update. Now publishing your dives on the web is only one mouse click
If you don't mind me asking. How did you do that? Does it require an OBDC connection or can it connect to the database directly. Further more I just remember that my hosting company doesn't allow direct connections to its database server. So I'm stuck with the mysql dump :( I'll add an option to the plugin for easy uploading of the sql file.

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

Post by divinglog » Sat Oct 07, 2006 21:48

I use the VBMySQLDirect DLL. Another way would be as you said with an ODBC connection. Yes, some providers unfortunately doesn't allow connecting the database from external tools :cry:

André
Posts: 25
Joined: Fri Sep 09, 2005 10:25

Post by André » Wed Oct 25, 2006 05:06

Lloyd,

just installed phpDivingLog, very nice.


Thank you for your work.

André

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

Post by lloyd_borrett » Sun Nov 19, 2006 21:15

G'day Sven,

Are there any changes in the Diving Log 4.0.6 update that are likely to effect phpDivingLog?

That is, any database changes, or changes to how things are being handled that I should be aware of?

Best Regards, Lloyd Borrett.

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

Post by divinglog » Sun Nov 19, 2006 22:00

Hi Lloyd

No Changes to the database layout. The only changes are in the MySQL export options, like tablename prefix. This could be an option in the config file of phpDivingLog.

Kind regards,
Sven

@rno
Posts: 29
Joined: Wed Nov 15, 2006 10:58
Location: Wanroij, Holland

Post by @rno » Mon Nov 20, 2006 12:52

Hello,

Not sure if this is the right place for this question but if not I hope to hear where to put it.....

I have just downloaden version 1.8 and uploaded it to my webserver. Everyting works but the drawing of the diveprofile graph.

When I use my localhost (with php and mysql configured) the graph is drawn, so I expect it has something to do with the config of my website.
Would someone happen to know what could cause this?

My webhost is using PHP 4.3.11 for my website with GD 2.0.28 support.....
Everything else works fine (also pictures with my dives)

Hope someone knows how to solve this....

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

Post by lloyd_borrett » Mon Nov 20, 2006 21:24

G'day,

That's a problem I'm unlikely to be able to help you with, but hopefully someone else can. What operating system, web server and MySQL versions are you using? These parameters might also come into play.

Best Regards, Lloyd Borrett.

@rno
Posts: 29
Joined: Wed Nov 15, 2006 10:58
Location: Wanroij, Holland

Post by @rno » Tue Nov 21, 2006 07:27

OS is Linux, but I am not able to determine which kernel version.
HTTPD = Apache (Apache release in phpinfo shows 10320100)

Mysql = 5.0.18 with mysql client 3.23.58

Of course I will be trying more options myself, but if anyone knows what might be wrong I'd be pleased to hear.

AndyDragon
Posts: 110
Joined: Tue Nov 14, 2006 08:38
Location: Penetanguishene, Ontario
Contact:

Post by AndyDragon » Tue Nov 21, 2006 22:28

Often these things are due to missing write permissions on a server. The Linux server where you are hosting, can you confirm the permissions are the same as your local machine? Lloyd, do you know if the graph generation code spits out a binary stream for the image, or does it store a temporary file on the HDD of the server which is then pulled via an <IMG> tag? I read through the graphing code and it seems like there is no writing to file. The image generated seems to be dumped as a binary stream and caching is off by default.

I did notice..there are two jpg-config.inc files for the jpgraph code. Are you using Windows at home (IIS) where it's working and Linux (Apache) where it's not? If you were using the jpg-config-windows.inc file copied to jpg-config.inc, you may need to copy the jpg-config-linux.inc over top of jpg-config.inc to get it working. If not, the only suggestion I have is to get a local Linux environment, spark up a PHP debugger and step through the code to see what is happening.
Andrew Forget
PADI IDC Staff Instructor 212158

Post Reply