forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Miscellaneous => Topic started by: Caio Borghoff on January 15, 2006, 04:24:42 am

Title: Google Earth Coppermine Flickr-like gallery MOD
Post by: Caio Borghoff on January 15, 2006, 04:24:42 am
For those who have Coppermine bridged with phpBB, I have created a MOD to display galleries images with Google Earth, like Flichr does.

Viisit http://www.phpbb.com/phpBB/viewtopic.php?t=357952 (http://www.phpbb.com/phpBB/viewtopic.php?t=357952) to see this MOD

I'm sure that even who don't have Coppermine bridged with phpBB could benefit form this MOD with some post-modifications.

The MOD is still in development, but is working for me with a few limitations. (see NOTES for details)

Have fun.

Caio Borghoff

Title: Re: Google Earth Coppermine Flickr-like gallery MOD
Post by: Joachim Müller on January 15, 2006, 11:39:06 pm
Pasting your initial announcement message into my posting and attaching your mod to it in case the page goes down some day. Thanks for the contrib.
Quote from: Caio Borghoff
MOD Title: Google Earth Coppermine Flickr-like gallery MOD

MOD Description: This mod allow to display geo-referenced Coppermine Gallery pictures with Google Earth (like Flickr) trough user profile buttons and trough Coppermine menu

MOD Version: 0.0.0

MOD Tested on: 2.0.17

NOTES:

This MOD require Coppermine Gallery bridged with phpBB (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#integrating)

The coordinates format must be decimal!!

This MOD still need modifications to allow user and admin to activate the Google Earth buttom from profile administration panel, to hide buttons from users that do not have geo-referenced pictures on Coppermine Galleries and to avoid pictures from private galleries to be displayed through Google Earth. By now, the admin must activate the user Google buttom from phpMyAdmin. Any contributions will be extremely appreciated.

This MOD is based on the 'Orkut Profile MOD' [ĞÆMØN øf NEME§I§] < gustavo@acidnuts.com > (Gustavo Montes) http://www.phpbb.com.br and   on original "Export to Google Earth KML" hack from dawidi posted on Atlas Mod forum (http://jonemo.de/atlasmod/forum/viewtopic.php?t=16)


DOWNLOAD (http://www.caioborghoff.fot.br/download/Google_Earth_Coppermine_Flickr-like_gallery_MOD.tar.gz)

DEMO for all gallery pictures here (http://portalimagemsub.caioborghoff.fot.br/forum/geofoto.php?.kml)

DEMO for user pictures profile buttom (http://portalimagemsub.caioborghoff.fot.br/forum/profile.php?mode=viewprofile&u=2)

Have fun

Caio Borghoff


**Sorry for any spelling erros. English is my second language.**

[edit 2006-01-25]
Please note: Caio's mod has gone into another direction, so I recommend going to the page Caio refered to and get the most recent version of his mod there. This posting is only there for reference, it contains an outdated copy of the initial mod. The mod description (the text I quoted) has changed as well.
[/edit]
Title: Re: Google Earth Coppermine Flickr-like gallery MOD
Post by: Joachim Müller on January 15, 2006, 11:41:26 pm
Is it possible to use this mod as well with standalone coppermine (without having it bridged with phpBB)? If yes, how is this done.
Title: Re: Google Earth Coppermine Flickr-like gallery MOD
Post by: Tranz on January 24, 2006, 01:42:26 am
There's a $CONFIG variable that stores the gallery's location so you can use that instead of the URL in the code. $CONFIG['ecards_more_pic_target']
Title: Re: Google Earth Coppermine Flickr-like gallery MOD
Post by: Caio Borghoff on January 25, 2006, 06:58:29 am
Gaugau,

Please update your quote, because my MOD went in completely different direction.

Now it is integrated with TranzNDance Coppermine photos/files on Google Maps MOD (http://forum.coppermine-gallery.net/index.php?topic=26571.0)

Now the only modification needed to work in standalone Coppermine is in the "geofoto.php". I don't know how to do that, but here is the original code that works with phpBB.

Code: [Select]
<?php
define
('IN_PHPBB'true);
$phpbb_root_path './';
include(
$phpbb_root_path 'extension.inc');
include(
$phpbb_root_path 'common.'.$phpEx);

   
$sql "SELECT pid, title, caption, owner_name, filepath, filename, user1, user2, user3, user4, user5, latitude, longitude FROM cpg_pictures WHERE NOT (longitude=0 AND latitude=0)";
   if ( !(
$result $db->sql_query($sql)) )
   {
      
message_die(GENERAL_ERROR'Could not obtain pics list'''__LINE____FILE__$sql);
   }
header('Content-type: application/keyhole');
?>

<kml xmlns="http://earth.google.com/kml/2.0" encoding="ISO-8859-1">
<Document>
<LookAt>
    <longitude>-32</longitude>
    <latitude>-4</latitude>
    <range>1400000</range>
    <tilt>30</tilt>
    <heading>0</heading>
 </LookAt>
<description>Your Gallery Title</description>
  <Style id="myPM">
    <IconStyle>
      <Icon>
        <href>http://www.yourdomain.com/images/icon.gif</href>
      </Icon>
    </IconStyle>
  </Style>
<?php

   
while ( $row $db->sql_fetchrow($result) )
   {
      echo(
"<Placemark><name><![CDATA[Photo ".htmlentities($row['pid'])."]]></name><description><![CDATA[www.yourdomain.com<br /><br />]]><![CDATA[<a href=\"http://www.yourdomain.com/coppermine/displayimage.php?pos=-".htmlentities($row['pid'])."\"><img src=\"http://www.yourdomain.com/coppermine/albums/".htmlentities($row['filepath']).htmlentities($row['filename'])."\" width=\"380\"></a><br /><font face=\"Verdana\" style=\"font-size: 14pt;\" color=\"#b00\"><b>".htmlentities($row['title'])."</b></font><br />Copyright &copy; ]]><![CDATA[".htmlentities($row['owner_name'])." <br /><br /><br />]]><![CDATA[<table width=\"380\" height=\"100%\"><tr><td>".htmlentities($row['caption'])."</td></tr></table><br / >]]><![CDATA[<a href=\"http://www.yourdomain.com/coppermine/displayimage.php?pos=-".htmlentities($row['pid'])."\">See image details...</a><br /><br />]]><![CDATA[<b>Custom field 1: </b><br/>]]><![CDATA[".htmlentities($row['user1'])." <br /><br />]]><![CDATA[<b>Custom field 4</b><br />]]><![CDATA[".htmlentities($row['user4'])." <br /><br />]]><![CDATA[<a href=\"http://www.yourdomain.com/coppermine/addfav.php?pid=".htmlentities($row['pid'])."\">Add to My Favorites</a><br /><br />]]></description><styleUrl>#myPM</styleUrl>");
      echo(
"<Point><coordinates>".$row['longitude'].",".$row['latitude']."</coordinates></Point></Placemark>");
   }

?>

</Document>
</kml>

If someone could change the first lines of the code above to allow this file to run inside Coppermine directory, you can add it to TranzNDance  MOD files and run this script to integrate with Google Earth.

 
Title: Re: Google Earth Coppermine Flickr-like gallery MOD
Post by: Caio Borghoff on January 25, 2006, 07:07:48 am
There's a $CONFIG variable that stores the gallery's location so you can use that instead of the URL in the code. $CONFIG['ecards_more_pic_target']

Not yet, because my MOD is bridged with phpBB. I don't know if it will work with the $CONFIG variable. Maybe you can copy the code in the previous post and change it to run inside Coppermine. If you do that you will be able to use it as an addon on your MOD. Please don't forget to quote the original author (this is a modification form a dawidi hack posted on Atlas Mod forum (http://jonemo.de/atlasmod/forum/viewtopic.php?t=16) )  if you decide to use it.

cheers
Title: Re: Google Earth Coppermine Flickr-like gallery MOD
Post by: Joachim Müller on January 25, 2006, 07:28:41 am
I suggest you paste the quote into your first post, then you can edit it as you see fit whenever you like. I'll modify the whole posting of mine. I would have prefered it though if you had started another thread and left the existing one as-is, but anyway, it's your mod.
Title: Re: Google Earth Coppermine Flickr-like gallery MOD
Post by: Tranz on January 25, 2006, 05:42:48 pm
Not yet, because my MOD is bridged with phpBB. I don't know if it will work with the $CONFIG variable. Maybe you can copy the code in the previous post and change it to run inside Coppermine. If you do that you will be able to use it as an addon on your MOD. Please don't forget to quote the original author (this is a modification form a dawidi hack posted on Atlas Mod forum (http://jonemo.de/atlasmod/forum/viewtopic.php?t=16) )  if you decide to use it.

cheers
Can't you get the info from the config table? You can get the pic data from Coppermine, so you should be able to  get the config info.