Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

GoogleMapDirectory

123468

Comments

  • 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 using MySQL 4.1.21-standard
  • 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.