[Mapbender-commits] r8207 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Nov 17 05:27:14 EST 2011


Author: armin11
Date: 2011-11-17 02:27:14 -0800 (Thu, 17 Nov 2011)
New Revision: 8207

Modified:
   trunk/mapbender/http/classes/class_wms.php
Log:
truncate tweet to 140 chars

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2011-11-17 10:17:38 UTC (rev 8206)
+++ trunk/mapbender/http/classes/class_wms.php	2011-11-17 10:27:14 UTC (rev 8207)
@@ -1683,7 +1683,7 @@
 			//combine text for tweet
 			$tweetText = "NEW WMS: " . $this->wms_title." (".$myWMS.") ".self::getWmsMetadataUrl($myWMS)." ".$this->wms_abstract;
 			//reduce to 140 chars
-			$tweetText = substr($tweetText, 0, 139);
+			$tweetText = substr($tweetText, 0, 136)." ...";
 			//push to twitter
 			$result = $twitter_wms->postTweet($tweetText);
 		}
@@ -1770,7 +1770,7 @@
 				//combine text for tweet
 				$tweetText = "NEW LAYER: " . $currentLayer->layer_title." (".$currentLayer->db_id.") ".self::getLayerMetadataUrl($currentLayer->db_id)." ".$currentLayer->layer_abstract;
 				//reduce to 140 chars
-				$tweetText = substr($tweetText, 0, 139);
+				$tweetText = substr($tweetText, 0, 136)." ...";
 				//push to twitter
 				$result = $twitter_layer->postTweet($tweetText);
 			}
@@ -2720,7 +2720,7 @@
 			//combine text for tweet
 			$tweetText = "UPDATED WMS: " . $this->wms_title." (".$myWMS.") ".self::getWmsMetadataUrl($myWMS)." ".$this->wms_abstract;
 			//reduce to 140 chars
-			$tweetText = substr($tweetText, 0, 139);
+			$tweetText = substr($tweetText, 0, 136)." ...";
 			//push to twitter
 			$result = $twitter_wms->postTweet($tweetText);
 			//for each layer which was deleted
@@ -2729,7 +2729,7 @@
 				$twitter_layer = new twitter();
 				$tweetText = "DELETED LAYER: " . $oldLayer['title']." (".$oldLayer['id'].") ".self::getLayerMetadataUrl($currentLayer->layer_id)." ".$currentLayer->layer_abstract;
 				//reduce to 140 chars
-				$tweetText = substr($tweetText, 0, 139);
+				$tweetText = substr($tweetText, 0, 136)." ...";
 				$result = $twitter_layer->postTweet($tweetText);
 			}
 			



More information about the Mapbender_commits mailing list