I installed the module and went to find the page with the map only to find it in under the admin path which is not something I want my visitors going to. So I dug into the code thinking I'd pull the theme function and stick it into Panels. But this was the only theme function I found:
function theme_visitorinfo_map($count) {
$output = '<div>' . t('Last @count visitor locations.', array('@count' => $count)) . '</div>';
$output .= '<div id="map"></div>';
return $output;
}
Am I blind or does that not actually print the map?
This module is nice if you run a blog and just want to privately see where your visitors are from but I'd really like to see it usable as a visitor map available to the membership.
Thanks,
Michelle
Comments
Comment #1
twooten commentedHi Michelle,
Yes, that is the function that prints the map. Am I correct in thinking that you want to be able to call a 'print_map()' or some such function from a tpl.php or panels page, etc.?
Tim
Comment #2
michelleWell, calling theme('visitorinfo_map'); would make sense... Only that won't do anything useful. It's assuming you've already calculated the $count variable and it doesn't actually have anything in there to print a map. From looking through the code, it looks like you do calculations in a private function first and then use this theme function. If you switched it around so the theme function calls the needed functions to get its data, then the theme function can be used by other modules/themes.
Michelle
Comment #3
jamiechef commentedHi Michelle i second that , this module would be fantastic if the visitors can also see the map , perhaps in a block or a menu link to the visitor map that users can see.
Thanks for the module though good work
Comment #4
twooten commentedHey Michelle and Jamiechef,
I'm glad you both like the module. I am going to add better theming support to it over the next couple of weeks. This was my first contributed module and so I'm just getting my feet wet with CVS and learning how to work with the issue queue, etc. Just wanted you to know I am listening and will make some changes.
Jamiechef, not sure about the block idea. It can certainly be done but in my experience google maps do not work well in a block, especially when you have lots of map points. Depends on the size of the block really.
Tim
Comment #5
michelleA theme function would be flexible enough that it could be tossed in a custom block if wanted. Me, I'll take the theme function and make a CTools content type out of that. I can toss it back as a patch if you want.
Michelle
Comment #6
twooten commentedthat'd be great Michelle.
Tim
Comment #7
preetinder commentedYou can enable visitors of the website to see the visitors map & block.
Just set its permissions to be viewable by Anonymous users & then create a URL alias for this page.
Follow these steps.
Visit http://www.yoursite.com/admin/user/permissions
Change "access visitorinfo" for "visitorinfo module" for Anonymous/Authenticated Role.
Add new alias
Go to http://www.yoursite.com/admin/build/path/add
In "Existing system path:" Enter admin/reports/visitorinfo
In "Path alias:" Enter visitorinfo
Press Create New Alias & then visit www.yoursite.com/visitorinfo
To Display Last 10 visitor info block on this page, just set the block to be visible only on visitorinfo page.
Hope this helps.
Tony
Comment #8
michelle@tony31: Thanks but a page alias isn't what I'm looking for.
Michelle
Comment #9
twooten commentedComment #10
michelle@twooten: I don't see anything in the CVS log about this... Did you add the theme function? What's it called?
Michelle
Comment #11
twooten commentedI implemented hook_theme() and registered 'visitorinfo_map' in version 6.x-1.3. I've just now been able to show this module some attention. I wanted to clean up the issue queue before tackling the bugs, feature requests, etc. I was hoping to have a new release out this weekend but need to push through a couple of issues first.
I'm adding some configurations options to this version.
Tim
Comment #12
michelleGreat, thanks! I'll keep an eye out. I don't have a pressing need since this is more of a fun item than an essential site piece so will wait for the next release.
Michelle