[Mapbender-commits] r8227 - in trunk/mapbender: conf http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Dec 8 07:42:55 EST 2011


Author: armin11
Date: 2011-12-08 04:42:55 -0800 (Thu, 08 Dec 2011)
New Revision: 8227

Modified:
   trunk/mapbender/conf/mapbender.conf-dist
   trunk/mapbender/http/php/mod_showMetadata.php
Log:
Show a twitter sign in the metadata module which can be used to share these informations ;-). The module uses  short versions of the metadatalinks which ha to be generated thru apaches mod_rewrite: http://server/wms/[id],  http://server/layer/[id], http://server/wmc/[id], ...

Modified: trunk/mapbender/conf/mapbender.conf-dist
===================================================================
--- trunk/mapbender/conf/mapbender.conf-dist	2011-12-06 14:57:06 UTC (rev 8226)
+++ trunk/mapbender/conf/mapbender.conf-dist	2011-12-08 12:42:55 UTC (rev 8227)
@@ -155,10 +155,11 @@
 # --------------------------------------------
 # TWITTER
 # This need a twitter.conf file with the keys and tokens for the twitter account. See conf/twitter.conf-dist.
+# The TWITTER_METADATA will show a twitter sign below inside the metadata html view which can be shared
 # --------------------------------------------
 define("TWITTER_NEWS", false);
+define("TWITTER_METADATA", false);
 
-
 #---------------------------------------------
 # PREVIEW
 # This path is defined to allow a saving of preview pictures for the content of wms/layers and 

Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php	2011-12-06 14:57:06 UTC (rev 8226)
+++ trunk/mapbender/http/php/mod_showMetadata.php	2011-12-08 12:42:55 UTC (rev 8227)
@@ -893,6 +893,8 @@
 }
 
 
+
+
 if ($layerAccessibility && WRAPPER_PATH != '' && ($resource == 'layer' or $resource == 'wms' )) {
 	$showMapUrl = $mapbenderBaseUrl.WRAPPER_PATH."?LAYER[zoom]=1&LAYER[id]=".$resourceMetadata['contentid'];
 	//$html .= $t_a.$translation['addLayerToMap'].$t_b."<a href='".$showMapUrl."' target='_blank'><img src='../img/osgeo_graphics/layer-wms-add.png'></a>".$t_c;
@@ -912,6 +914,21 @@
    return false;><img src='../img/osgeo_graphics/layer-wms-add.png'>".$translation['showMap']."</button>".$t_b."".$t_c;
 	
 }
+//new for share and discuss metadata by twitter
+if (TWITTER_METADATA) {
+	if ($resource == 'wfs' or $resource == 'wms') {
+		$dataUrl = $mapbenderBaseUrl."/".$resource."/".$resourceMetadata['serviceid'];
+		$dataCountUrl = $mapbenderBaseUrl.$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
+	} else {
+		$dataUrl = $mapbenderBaseUrl."/".$resource."/".$resourceMetadata['contentid'];
+		$dataCountUrl = $mapbenderBaseUrl.$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
+	}
+	$twitterUrl="https://twitter.com/share";
+	$html .=  '<script charset="utf-8" src="//platform.twitter.com/widgets.js" type="text/javascript"></script>';
+	$html .=  $t_a.'<a href="'.$twitterUrl.'" class="twitter-share-button" data-url="'.$dataUrl.'" data-count="none" >Tweet</a>'.$t_b."".$t_c;
+}
+#data-counturl="'.$dataCountUrl.'"
+#data-url="'.$dataUrl.'"
 
 $html .= $tableEnd;
 $html .= '</p>';



More information about the Mapbender_commits mailing list