Discussion in "Map Me Support" started by    Penbrock    Feb 25, 2008.
Mon Aug 24 2009, 02:30 am
#21
hey i am adding new stuff.. working on new release.. hope i finish it soon!

i hope everyone like this one well i am pretty sure of that
Tue Aug 25 2009, 01:24 am
#22
I really do love this! It's brilliant! My users seem to love it also. It's only been there a couple of days and already have 26 users on it.

I'm not sure if you want this, but it's my mapjs.php. My PHP coding isn't that neat nor dynamic, but it usually works created a couple more columns in the database.

Please keep at it!

<?php
/*
+---------------------------------------------------------------+
|        Map Me! for e107 v0.7
|
|        A plugin for the e107 website system
|        http://www.e107.org/
|
|        Ajay Bhargav
|        http://www.rickeyworld.info
|        [email protected]
|
|        Special thanks to nlstart for bugfixes
|
|        Released under the terms and conditions of the
|        GNU General Public License (http://gnu.org).
+---------------------------------------------------------------+
*/

	require_once("../../class2.php");
	
  // Get language file (assume that the English language file is always present)
  $lan_file = e_PLUGIN."mapme/languages/".e_LANGUAGE.".php";
  include_lan($lan_file);
	
	header("Content-type: application/x-javascript");
	
	global $pref;
	$sql->
mySQLresult = @mysql_query("SELECT ".MPREFIX."gmarkers.*, ".MPREFIX."user.user_name, ".MPREFIX."user.user_image FROM `".MPREFIX."gmarkers`, ".MPREFIX."user where ".MPREFIX."gmarkers.user_id = ".MPREFIX."user.user_id");
	$rows=$sql->
db_Rows();
	$userloc = "";
	if($rows){
 		for($i=0;$i<$rows;$i++){
 		 	$row = $sql->
db_Fetch();
			$userloc .= "[".$row['lat'].", ".$row['lng'].", ".$row['user_id'].", '".$row['user_name']."', '".$row['loc']."', '".$row['icoclass']."', '".$row['eventurl']."', '".$row['user_image']."', '".$row['eventdate']."']";
			if($i!=$rows-1)
				$userloc .=",";
		}
	}

		$ret = "
		//<![CDATA[
		
		var userloc = new Array (".$userloc.");
		
		function createMarker(point, id, name, loc, icoclass, eventurl, userimage, eventdate){
				Icon.image = '".e_PLUGIN_ABS."mapme/images/green.png';

				if(icoclass=='1'){Icon.image = '".e_PLUGIN_ABS."mapme/images/red.png';}
				if(icoclass=='2'){Icon.image = '".e_PLUGIN_ABS."mapme/images/pink.png';}
				if(icoclass=='3'){Icon.image = '".e_PLUGIN_ABS."mapme/images/orange.png';}
				if(icoclass=='4'){Icon.image = '".e_PLUGIN_ABS."mapme/images/blue.png';}
				if(icoclass=='5'){Icon.image = '".e_PLUGIN_ABS."mapme/images/yellow.png';}
			var marker = new GMarker(point, Icon);
			GEvent.addListener(marker, 'click', function() {
				
				var html = '<div style=\"width:250px; height:100px\">
<div style=\"float:right; width:140px; text-align:left;\">
<a href=\"".SITEURL."user.php?id.'+ id +'\">
<b>
'+ name +'</b>
</a>
<br />
Hi, my name is '+ name + ' and I am from ' + loc;
				if(icoclass=='3'){var html = '<div style=\"width:250px; height:100px\">
<div style=\"float:right; width:140px; text-align:left;\">
<a href=\"".SITEURL."user.php?id.'+ id +'\">
<b>
'+ name +'</b>
</a>
 - '+ eventdate +'<br />
This event is being held at ' + loc;}
				if(eventurl !=''){html = html + '<br />
Please click <a href=\"' + eventurl + '\">
here</a>
 to see the forum thread.';}

				var uimage = '<img src=\"".e_PLUGIN."mapme/images/noavatar.gif\" alt=\"' + name + '\" />
';				

				if(userimage != ''){
					uimage = '<img src=\"' + userimage + '\" alt=\"' + name + '\" style=\"max-width:100px;\" />
';
				}
				html = html + '</div>
<div style=\"float:left; max-width:100px; text-align:left;\">
' + uimage + '</div>
</div>
';
				
				marker.openInfoWindowHtml(html);
			});
			return marker;
		}
		
		function add_user(){
			for (var i = 0; i < userloc.length; i++) {
				var point = new GLatLng(userloc[i][0], userloc[i][1]);
				var marker = createMarker(point, userloc[i][2], userloc[i][3], userloc[i][4], userloc[i][5], userloc[i][6], userloc[i][7], userloc[i][8]);
				map.addOverlay(marker);
			}
		}
		
		////map

		var map = new GMap2(document.getElementById('map'));
		map.setCenter(new GLatLng('54.749991','-4.042969'), 5);
		map.addControl(new GMapTypeControl(1));
		map.addControl(new GLargeMapControl());

		map.enableContinuousZoom();
		map.enableDoubleClickZoom();

		var ovSize=new GSize(100, 100);
		var ovMap=new GOverviewMapControl(ovSize);
		map.addControl(ovMap);
		var mini=ovMap.getOverviewMap();
	
		map.hideControls();
		GEvent.addListener(map, 'mouseover', function(){
			map.showControls();
		});
		GEvent.addListener(map, 'mouseout', function(){
			map.hideControls(); 
		});

		var Icon = new GIcon();
		Icon.image = '".e_PLUGIN_ABS."mapme/images/green.png';
		Icon.shadow = '".e_PLUGIN_ABS."mapme/images/shadow.png';
		Icon.iconSize = new GSize(12, 20);
		Icon.shadowSize = new GSize(22, 20);
		Icon.iconAnchor = new GPoint(6, 20);
		Icon.infoWindowAnchor = new GPoint(5, 1);

		add_user();
	
		//]]>

		";
	echo $ret;
?>

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am
ArnoldDiant
Fri Apr 26 2024, 03:53 am