Fork me on GitHub
Current Releases are 2.1 stable (major release) and 2.0.18.11 (security patch for 2.0)
We've also rebooted our GitHub repo, docs, and more!

GoogleMapDirectory

1246

Comments

  • Hi circuit, all add points 1 & 3. Unfortunately point 2 is a long running mystery. I can't replicate this error, some users have suggested migrating forums might be a common cause of issue here, we're starting to suspect its vanilla setups that are causing the error not clean vanilla's with a clean extension install. I'm officially at a loss as to how to solve it and please, if anyone else out there has the inclination or knowledge either have a go at fixing or post some suggestions to what it might be on here and i'll have another go at solving.
  • thanks for the reply. this would be really useful if i could get it working.
  • Ok I´ve read this discussion one too many times. I'm having a similar problem as many others. I have a new install of Vanilla and the latest Extension, but when I add a pin to the map it doesn´t show up. I try to search for it, and it doesn't find it. Anybody figuring this out?
  • no one working on this anymore? I figure I might have a simple problem but nothing seems to work. I put pins on and they disappear. Oh well, great idea at least
  • It seems to work for me. I just tested again by adding a new location. If you want to chat, let me know. That might be a more productive way of helping.
  • When I said it worked for me, I meant with old version 0.3. I just downloaded version 0.4 and uploaded to my live forum to try and help ryanopaz. I never had the old version on my live site. All went well, but when I tried to add a location, it never appeared. I get the error as another mentioned:

    invalid flag after regular expression
    http://www.jwurster.us/Vanilla.1/extensions/GoogleMapDirectory/map.js
    Line 111

    @davidk43: I'd be happy to help you debug this and find the solution. Just let me know what to do.
  • I think I have eliminated the setLatitude error and the RoleID error. However, I still cannot see the markers I add.

    In the ajax.php file, add ",g.RoleID" to line 18 in the Select statement.

    In the default.php file, before the line:
    echo '<h1>'.$setLatitude.'</h1>';

    I inserted the line:
    $setLatitude = ForceIncomingString("Latitude", ""); //jimw

    Since I'm not sure what should be in that variable at the time, this probably won't fix the problem.

    But this is just what I've seen in my quest to help.

    Edit: I just successfully rolled back to version 0.3 on my live site, painlessly.
  • Firstly a caveat - I've never written in any of the technologies involved in Vanilla. However, there's nothing like a little determination when you really want something working! :)

    jimw - I think there may be an error in your RoleID fix. i think it should be "u.RoledID" not "g.RoleID" as, at least in my fresh 0.4 install, LUM_GoogleMapDirectory_Locations doesn't contain a RoleID column (this is the table that g maps to in the query, while u maps to the LUM_User table which DOES have a RoleID.) This sounds like the right place to retrieve the role from. BTW for anyone reading, this SELECT statement retrieves the list of locations from the database. Which brings me neatly to...

    To fix the fact that no locations are returned, you probably need to modify the query further (or at least, I did). If you run the query as written in default.php, it gives a SQL error and returns no rows - again, this may be specific to my install (I need to check my version of MySQL) but executing the query in MyAdmin I don't get any rows back and it threw a sql error. To get around this (I really have been desparate to get this thing working!!) I hacked the query in ajax.php so that it now reads:

    $Query = "SELECT
    g.LocationID,g.UserID,u.Name,u.Name AS LastEditedByName,
    g.Title,g.Category,g.Description,g.Address,g.Telephone,
    g.Link,g.Thread,g.Latitude,g.Longitude,
    u.RoleID FROM LUM_GoogleMapDirectory_Locations g,
    LUM_User u WHERE g.UserID=u.UserID ";

    NOTE I KNOW this is a good ol' fashioned hack to get the thing working! Essentially, I have removed the sub-query that provided the last-edit user name information (I think that the creator and the last editor will always be the same which, for now, is just a minor irritation - but nothing more than that). You can check that you have everything working correctly by running the following URL:

    http://YOUR.DOMAIN/extensions/GoogleMapDirectory/ajax.php?action=getLocations&Search=

    If you've got it right you get your locations list back without any errors.

    I'll spend some time on this maybe next week to see if I can get the query to run as it was intended, but until then I have 0.4 working pretty well.

    Except for one, small, irritating detail: I get the following error on the Google Map Directory page:

    uncaught exception: script.aculo.us requires the Prototype JavaScript framework >= 1.4.0

    I can see that it's the /js/scriptaculous.js that's throwing the exception but I can't figure out quite why (I have Prototype.js version 1.4.0_rc2 which is what ships with Vanilla 1.1.2). It seems to be that the Prototype object is undefined when it scriptaculous tests for it??? It feels like a clash with something else on the install but any help would be great. It doesn't seem to stop anything working but it's not pretty :(

    Apologies for a long post and very little experience in this area but hopefully it might provide some pointers as to what has been going on!
  • @paul: Thanks for catching that and your explanation. Since I have the old version working, I don't think I'll play around with the new version any more (too many other things to do).
  • Paul, that's a great piece of detective work! Apologies for my absence, I've been many miles from a computer on a sandy beach on the Med, coding has wonderfully taken a considerable back seat for a bit. As for your caveat Paul, it applies to me also and I'm amazed this plugin has got this far - the reason I haven't helped fix the bugs that are still outstanding is that I'm literally at the edge of my knowledge so can't help. It looks like you've hit on something though. So the subquery on ajax.php is kicking out an error? Let me know what version of mySql you're on, perhaps there's a more laboured join statement I can write that'll work for all versions of mySql, though that subquery looked pretty standard to me. This kind of returns to my very first request when posting version 0.1 for someone to help write all the queries for SQLBuilder in Vanilla so its truly compatible...
  • For me I just tried removing the following from /extensions/GoogleMapDirectory/ajax.php (line 49):
    , '.' "CurrentRoleID": "'.$Context->Session->RoleID.'"
    And it seemed to work a little better...still getting an uncaught expression error (tho that might be due to something else as I get that error on the settings page too). In any case, at least the locations are appearing now.
  • Also, I'm using v0.4 and quotes are still not being escaped properly. They are showing up with a preceeding slash (\).

    For example: skube's bar
    Shows up as: skube\'s bar
  • I also have a suggestion... I think it would look better if the locations were listed in the side panel instead of below the map.
  • Hi Skube, I noticed the (non)escape the other day on one of mine, I think you'll find that's due to an older entry made prior to 0.4 - let me know if not but mine are escaping correctly (it may be my tests are on a version slightly higher that 0.4 but its the weekend and i can't be arsed to look it up right now!). My original map before releasing here did actually have the locations in the panel, as that seemed the natural way to harness Vanilla, but it doesn't scale very well, so I decided to shunt it under the map which for higher volumes of locations does work better. Can we rustle up a consensus of what versions of MySQL are being used here? I'd love to know if the version of SQL is whats breaking it for the key users reporting on this thread of the RoleID error. Taking the RoleID off means the admin level of editing via the settings page no longer would apply.
  • I'm having issues with the pins making the database but not displaying. I'm using Safari but it (latest version now, but have tried them all without success) seems to not work for any browser, Mac and Win. Here is my server info: Apache version 1.3.37 (Unix) PHP version 4.4.7 MySQL version 4.1.22-standard
  • Hello. I also had the exact two "RoleID" and "Latitude" errors mentioned in this thread... fresh vanilla with a few extensions installed... fresh googlemapdirectory extension installation.
  • I had the problem with showing of items on the map (just empty map showed)

    After some debugging I was able to see where the problem is. I have changed the code so that it works for me. Before doing changes I suggest, note that this will change some behavior of the extension, so read carefully

    Changes here are NOT tested very good. It is highly possible that some of the changed could have been implemented better, but I don't have time to research further. They may change or brake some of the functionalities of the extension, so once again: read carefully what is written below.

    Backup!


    CHANGES IN ajax.php



    • after
      if($_REQUEST['action']=='getLocations') {
      change the $Query string
      from

      $Query = "SELECT
      g.LocationID,g.UserID,u.Name,
      (SELECT l.Name FROM LUM_User l WHERE l.UserID = g.LastEditedByID) AS LastEditedByName,
      g.Title,g.Category,g.Description,g.Address,g.Telephone,g.Link,g.Thread,
      g.Latitude,g.Longitude
      FROM LUM_GoogleMapDirectory_Locations g,LUM_User u WHERE g.UserID=u.UserID ";

      to following

      $Query = "SELECT
      g.LocationID,g.UserID,u.Name,'none' AS LastEditedByName,
      g.Title,g.Category,g.Description,g.Address,g.Telephone,g.Link,g.Thread,
      g.Latitude,g.Longitude
      FROM LUM_GoogleMapDirectory_Locations g,LUM_User u WHERE g.UserID=u.UserID ";

      this will allow appearing of the items on the map, but it will show none in the part: last changed by none. Since, I removed this information anyway, this doesn't bother me. If you need this information, you can change the query so that it will make LEFT join with LUM_user table.


    • few lines above the end of the file:
      change:
      ' "CurrentRoleID": "'.$Context->Session->RoleID.'"}';
      to
      ' "CurrentRoleID": "'. 0 .'"}';
      this fixed some JS errors I was getting. It is possible that this change caused one of problems described below.


    CHANGES IN map.js



    • line 138, change from
      if(CurrentUserID>0){Label += '<p><a href="extension.php?PostBackAction=GoogleMapDirectory_editLocation&LocationID=' + LocationID + '">Edit this location</a></p>';}
      to
      if(CurrentUserID==1){Label += '<p><a href="/forum/extension.php?PostBackAction=GoogleMapDirectory_editLocation&LocationID=' + LocationID + '">Edit this location</a></p>';}
      This will show Edit this link only to the user with id equal to 1. In my case this is me, administrator. Most probably it should be better to use user role check, but I don't want to dig into the code.

    • I deleted lines 140 and 141. Here are how they look like originally:

      Label += '<p>Created by '+Name;
      if(LastEditedByName!=''){Label += ', Last edited by '+LastEditedByName;}

      This will stop showing the Created by and Last edited by things in item baloon on the map. Last edited by will always show 'none', because of the changes we did to the $Query in first part of changes, and I don't need Created by. You can just delete the second line, or leave it as it is, this is not a bugfix, just some change of a look.


    • at the end of the file I added:


      ?>



    changes to default.php


    • Lines 268, 269 change from

      <div class="Submit">
      <input type="submit" name="btnSave" value="Save" class="Button SubmitButton EditCategoryButton" />';

      to

      <div class="Submit">';
      if(($this->PostBackAction=='GoogleMapDirectory_editLocation' && $this->Context->Session->User->RoleID=="4") || $this->PostBackAction=='GoogleMapDirectory_addLocation') {?>
      <input type="submit" name="btnSave" value="Save" class="Button SubmitButton EditCategoryButton" />
      <?php }

      This will only show Save button in edit mode to Administrator.


    Problems with URLs


      I also had some problems related to Friendly URLs and this plugin not being compatible with it. I edited all files where I saw some links, so that they will match my URL structure. Since those changes are just hardcoded, and I suppose that someone more familiar with Vanilla will post links worked with built-in functions by vanilla, I will not post all changes, just few advices
    • Search for '.php' in your files and see if the url should be changed

    • I have changed some links in default.php and map.js

  • Here is my solution.

    All you have to do is to go /extensions/GoogleMapDirectory/ajax.php (line 49):
    and change
    , '.' "CurrentRoleID": "'.$Context->Session->RoleID.'"

    to
    , '.' "CurrentRoleID": "'.$Context->Session->User->RoleID.'"

    You will see the marker eventually.
    However, do use a fresh install as I face several occasion that the database is corrupted after much testing.

    But I do have have a constant problem of
    forum/extensions/GoogleMapDirectory/default.php on line 184

    I could not use the solution that other user had highlighted, else the marker will not be shown.
    I use css to hide it eventually, so it does not affect me visually.



    One question, how do you add another map to overlay the existing map.
    For example, I wish to highlight the mountain trek using the KML. I have tried to apply the AddOverLay method, in the map.js
    But I could not get it to shown. I believe it must have some conflict with the markers overlay.
    Any guru could enlighten me?
  • Another things to highlight, it does not work with friendlyurl. Thus, for the menu tab, it has to be a direct url, else the marker can't be seen as well
  • After plugging away at it, I finally have it working miumiu. Thanks. But what changes did you make to the css to hide the 184 error?
  • Hi, Found a easier way You can go to the default.php search for this echo '<h1>'.$setLatitude.'</h1>'; and comment it out as // echo '<h1>'.$setLatitude.'</h1>'; Hope it helps..
  • can someone try to combine all this input into a new version of the add-on?
  • mvhaen, As far as i can see, the updates required are: 1) Friendly URL adaptation 2) Proper SQL_Builder integration These two things would probably fix most issues and the Role ID issue some are having. I'm reticient to roll back the Role ID functionality as it works for most. I'm convinced there's a Vanilla Guru out there who can fix these two things, but alas I'm far too busy and also at the end of my knowledge so can't further it. The problem with a lot of the suggested fixes above is that they're hacks, which is great when they get something working for an individual but not really what should be rolled into a release. You can always try the suggestions above and if it doesn't work, just reinstall a fresh copy as is. Where is that vanilla guru we've been pining for? I released this as it was hoping someone would be able to further it and fix the key plugin elements to get it smoothly into vanilla everytime.
  • I have the same "... line 184..." pb as the others.

    For info:
    I installed vanilla 2 days ago on a new server,
    I installed googlemapsdirectory version 0.4.

    so i don't think the pb is caused by an upgrade or a migration.

    It be so great if it could work soon ?!
    Thanks for the extension.
  • to

    miumiu
    CommentTimeAug 8th 2007

    I've just tried to

    "search for this
    echo '

    '.$setLatitude.'

    ';
    and comment it out as
    // echo '

    '.$setLatitude.'

    ';"

    didn't work
  • Pleeeaaase I so want this extension to work !!!!
  • Hey everyone, This may seem like another trivial question: The API key from Google, I tried inputting several URLs, from just <site> to <site>/this/that/etc, you know? Each one that I entered into the default.php was not recognized as one for my site. I kept getting the error: The Google Maps API key used on this web site was registered for a different web site. You can generate a new key for this web site at http://www.google.com/apis/maps/. Now, I know the URL should only be just the main site URL, <site>, but I have integrated my Vanilla 1.1.2 forum into my Wordpress webpage with an iframe. Can someone point me to the right URL to use? I'd really appreciate any of the help I can get. What the heck, here's my site http://stirbinatorlabs.com/wordpress/?page_id=22
  • Which key are you entering, the Vanilla forum key or WP key? On my WP blog, I have a page set up for my forum. I use a separate google map key for the forum and then I have another for WP.
  • I understand that davidk43 is too busy to actively maintain this plugin, and I also see that some people have been working on fixing this extension. Could the people that have found a fix, maybe put their entire code available, rather than just patches? Is there anyone willing to release an 0.5 version, and maybe become the new maintainer of this extension.
Sign In or Register to comment.