to previous topic Print topic to next topic

 Root :: Developments :: Modules :: advProfile and Map
 Moderated by:
 
  Bottom  advProfile and Map
katena Posted: 12.09.2006, 17:42
Noob
Noob


registered: Sep 09, 2006
Posts: 6

Status:  offline
last visit: 19.10.06
Hello,

I installed advProfile (great module!!) making a MAP tab page as in this site.
I make dynamic data field in user profile to get members latitude and longitude for Google Maps.
With Safari and Firefox is all OK, with IE I have blank tab page...
In this site instead all work also with IE, what coul be the problem?
This is my advProfile_user_map.tpl:
(renamed "script" in "XXXscript" to post in the forum)

Code
  1. <!--[* $Id: advProfile_user_comments.tpl,v 1.1 2005/09/03 21:29:21 chestnut Exp $ *]-->
  2. <div id="advprofile">
  3.  
  4. <!--[include file="default/advprofile_user_menu.tpl" page="maps"]-->
  5.  
  6.    
  7.     <XXXscript src="http://maps.google.com/maps?file=api&v=2&key=XXXcutmykey"
  8.       type="text/javascript"></XXXscript>
  9.     <XXXscript type="text/javascript">
  10.  
  11.     //<![CDATA[
  12.    
  13.     function load() {
  14.       if (GBrowserIsCompatible()) {
  15.         var map = new GMap2(document.getElementById("map"));
  16.         map.addControl(new GSmallMapControl());
  17.         map.addControl(new GMapTypeControl());
  18.         map.setCenter(new GLatLng(<!--[$LATITUDINE_VALUE|pnvarprephtmldisplay|pnvarcensor]-->, <!--[$LONGITUDINE_VALUE|pnvarprephtmldisplay|pnvarcensor]-->), 10);
  19.         var marker = new GLatLng(<!--[$LATITUDINE_VALUE|pnvarprephtmldisplay|pnvarcensor]-->, <!--[$LONGITUDINE_VALUE|pnvarprephtmldisplay|pnvarcensor]-->);
  20.         map.addOverlay(new GMarker(marker));     
  21.       }
  22.     }
  23.  
  24.     //]]>
  25.     </XXXscript>
  26.   </head>
  27.   <body onload="load()" onunload="GUnload()">
  28.     <div id="map" ></div>
  29.  
  30. </div>

thanks
Top  katena send PM
 
Chestnut Posted: 13.09.2006, 11:05
Site Admin
avatar

registered: Jun 02, 2002
Posts: 1320

Status:  offline
last visit: 07.02.08
See this for the example used on pnConcept :
HERE

icon_wink


Chestnut ! Cool
Site Admin
Top  Chestnut send PM Homepage
 
katena Posted: 13.09.2006, 17:18
Noob
Noob


registered: Sep 09, 2006
Posts: 6

Status:  offline
last visit: 19.10.06
thanks!
I copy the function.googlemap.php also.

At the moment no luck, blank tap page with all browser.
I also tried to put the google script in the mytheme master template but i doesn't work.
I'll check your code again to find a way.

thanks again
Top  katena send PM
 
katena Posted: 14.09.2006, 09:46
Noob
Noob


registered: Sep 09, 2006
Posts: 6

Status:  offline
last visit: 19.10.06
Resolved!!

In advProfile_user_map.tpl posted before I deleted all "head" and "body" tags,
renamed "function load()" to "function googlemap()"
added the line "window.onload = googlemap;" before "//]]>" line

Top  katena send PM
 
marvel Posted: 29.01.2007, 18:28
Noob
Noob


registered: Feb 16, 2006
Posts: 2

Status:  offline
last visit: 29.01.07
Howto get it work for dummys ?
working for hours with only bad results.
Googlemap (2.0) und Advprofil (2.1) alone works fine.
I got the googlemap.plugin.tpl and the function.googlemap.php.

I called the user_map.tpl like the other ones like last10xxx

Is there a chance do become a user_menu.tpl and user_map.tpl ready to run ?
Top  marvel send PM
 
Chestnut Posted: 29.01.2007, 18:49
Site Admin
avatar

registered: Jun 02, 2002
Posts: 1320

Status:  offline
last visit: 07.02.08
Marvel,

you need
advProfile/pntemplates/default/advProfile_plugin_googlemap.tpl
and
advProfile/pntemplates/plugins/function.googlemap.php
(Put these files in the appropriate folders as shown in the address)

Then, create a template called: advProfile_user_googlemap.tpl in modules/advProfile/pntemplates/default and insert in the template:

Code
  1. <div id="advprofile">
  2. <!--[if $error != 1]-->
  3.   <!--[$uname]-->
  4.   <!--[include file="default/advprofile_user_menu.tpl" page="googlemap"]-->
  5.  
  6.   <br />
  7.   <div id="advpmaininfo">
  8.     <!--[googlemap uid=$uid]-->
  9.   </div>
  10.  
  11. <!--[else]-->
  12.   <br /><br />
  13.   <h2 align="center">pnml name="_ADVPROFILEERROR"</h2><!--[$uname]-->
  14. <!--[/if]-->
  15. </div>

(remove the numbers at the start of each lines... damn code tag...)

Last thing to do is add a link to the advProfile_user_menu.tpl:

Code
  1. <li><a href="<!--[pnmodurl modname="advProFile" type="user" func="main" uname=$USERNAME_VALUE page="googlemap"]-->" title="Map">Map</a></li>


And you're done.

Chestnut ! Cool
Site Admin
Top  Chestnut send PM Homepage
 
marvel Posted: 29.01.2007, 21:37
Noob
Noob


registered: Feb 16, 2006
Posts: 2

Status:  offline
last visit: 29.01.07
Ok, thank you !
Works fine.
Great work @all ;)
Top  marvel send PM
 



Powered by pnForum Version 2.0.1
DarkMindZ