Modules: ClustrMaps integration - v.1.7
Serge D
Joined: 2009-06-11
Posts: 2466 |
Posted: Mon, 2009-10-19 00:52 |
ClustrMaps Sidebar module - allows adding small map of visitor to your site. Quote:
Do you know your audience? You will with ClustrMaps! Visitors don't need to click on anything: just viewing your page is sufficient. We provide (free) the HTML that gives you a tiny map, like the one on the left. When it loads, it increments a counter and shows the locations of all visitors to your page, cumulatively (even for huge numbers). Clicking on it zooms in to a big world map, and (optionally) lets you zoom in to the continents, as in the example above. --- |
|
Posts: 27300
Thanks for the contribution!
Not tested but where do you get the 2 variables needed from the ClustrMaps admin page? I guess I have to dig it out of the HTML they generate for me?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 2466
Yes, when you register and generate the html, you would notice that there is two parts in it:
User id is part of initial link:
Site id is part of the image reference:
Posts: 2466
New version is available.
Instead of breaking down url, you can now post the whole 'HTML Code' provided by the service.
It allows using advanced features of the "plus".
Posts: 5
Hi,
I rencently install the RC1 and wan't your module to work but i can't.
I installed your module as mentioned in the wiki, registered at ClustrMaps but when i add the html code in the module config it doesn't work.
In the module i only have a part of the link i paste in the config but not the map picture.
I check my php config to allow url open but doesn't fix.
So i check the link
In the clustrMaps admin i choose the second link:
and in the block it show à link like this:
If i click this link i get an error
And if i simplified the link this way nothing is shown:
Another bug when i modify the link in the admin the html code is parsed everytime i save.
Any idea
Regards David
Posts: 2466
I do not do anything special about the code
I will check if there were changes to how G3 stores data since the time module was published
Posts: 2466
Fixed. Please get latest version.
Posts: 5
Thanks it work well
Posts: 2466
version 1.6 released - sync update between all my modules for admin panel
Posts: 17
Hi Serge,
I've installed the latest version 1.6 but when trying to enter the settings"tab" i get the following message:
Exception [ 0 ]: @todo CLUSTRMAPS_NOT_CONFIGURED
1.
MODPATH/clustrmaps/helpers/clustrmaps.php[ 39 ]
34 return; 35 } 36 37 $html_code = module::get_var("clustrmaps", "html_code"); 38 if (empty($html_code)) { 39 throw new Exception("@todo CLUSTRMAPS_NOT_CONFIGURED"); 40 } 41 42 $caption = module::get_var("clustrmaps", "caption"); 43 if (empty($caption)) { 44 throw new Exception("@todo CLUSTRMAPS_NOT_CONFIGURED");
2.
MODPATH/clustrmaps/controllers/admin_clustrmaps.php[ 24 ] » Clustrmaps_Core::init()
19 */
20class Admin_clustrmaps_Controller extends Admin_Controller {
21
22 public function index() {
23 if (clustrmaps::is_configured()) {
24 clustrmaps::init();
25 }
26
27 $view = new Admin_View("admin.html");
28 $view->content = new View("admin_clustrmaps.html");
29 $view->content->form = $this->_get_setting_form();
3.
{Appel interne PHP} » Admin_clustrmaps_Controller->index()
4.
MODPATH/gallery/controllers/admin.php[ 62 ] » call_user_func_array( paramètres )
function_name
array(2) (
"0 (type: Admin_clustrmaps_Controller)" => array(1) (
"private: theme" => NULL
)
1 => string(5) "index"
)
parameters
array(0)
57
58 if (!method_exists($controller_name, $method)) {
59 throw new Kohana_404_Exception();
60 }
61
62 call_user_func_array(array(new $controller_name, $method), $args);
63 }
64
65 private static function _reauth_check() {
66 $session = Session::instance();
67 $last_active_auth = $session->get("active_auth_timestamp", 0);
5.
{Appel interne PHP} » Admin_Controller->__call( paramètres )
controller_name
string(10) "clustrmaps"
args
array(0)
6.
SYSPATH/core/Kohana.php[ 331 ] » ReflectionMethod->invokeArgs( paramètres )
object
array(1) (
"private: theme" => NULL
)
args
array(2) (
0 => string(10) "clustrmaps"
1 => array(0)
)
326
327 // Start the controller execution benchmark
328 Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');
329
330 // Execute the controller method
331 $method->invokeArgs($controller, $arguments);
332
333 // Controller method has been executed
334 Event::run('system.post_controller');
335
336 // Stop the controller execution benchmark
7.
{Appel interne PHP} » Kohana_Core::instance( paramètres )
0
NULL
8.
SYSPATH/core/Event.php[ 208 ] » call_user_func_array( paramètres )
function_name
array(2) (
0 => string(6) "Kohana"
1 => string(8) "instance"
)
parameters
array(1) (
0 => NULL
)
203 Event::$data =& $data;
204 $callbacks = Event::get($name);
205
206 foreach ($callbacks as $callback)
207 {
208 call_user_func_array($callback, array(&$data));
209 }
210
211 // Do this to prevent data from getting 'stuck'
212 $clear_data = '';
213 Event::$data =& $clear_data;
9.
APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( paramètres )
name
string(14) "system.execute"
62
63// End system_initialization
64Benchmark::stop(SYSTEM_BENCHMARK.'_system_initialization');
65
66// Make the magic happen!
67Event::run('system.execute');
10.
DOCROOT/index.php[ 102 ] » require( paramètres )
I must mention that i'm using G3 with Greydragon Wind theme.
Any idea what's going wrong?
Thanks.
jofrari
Posts: 17
Hi Serge,
I've installed the latest version 1.6 but when trying to enter the settings"tab" i get the following message:
Exception [ 0 ]: @todo CLUSTRMAPS_NOT_CONFIGURED
1.
MODPATH/clustrmaps/helpers/clustrmaps.php[ 39 ]
34 return; 35 } 36 37 $html_code = module::get_var("clustrmaps", "html_code"); 38 if (empty($html_code)) { 39 throw new Exception("@todo CLUSTRMAPS_NOT_CONFIGURED"); 40 } 41 42 $caption = module::get_var("clustrmaps", "caption"); 43 if (empty($caption)) { 44 throw new Exception("@todo CLUSTRMAPS_NOT_CONFIGURED");
2.
MODPATH/clustrmaps/controllers/admin_clustrmaps.php[ 24 ] » Clustrmaps_Core::init()
19 */
20class Admin_clustrmaps_Controller extends Admin_Controller {
21
22 public function index() {
23 if (clustrmaps::is_configured()) {
24 clustrmaps::init();
25 }
26
27 $view = new Admin_View("admin.html");
28 $view->content = new View("admin_clustrmaps.html");
29 $view->content->form = $this->_get_setting_form();
3.
{Appel interne PHP} » Admin_clustrmaps_Controller->index()
4.
MODPATH/gallery/controllers/admin.php[ 62 ] » call_user_func_array( paramètres )
function_name
array(2) (
"0 (type: Admin_clustrmaps_Controller)" => array(1) (
"private: theme" => NULL
)
1 => string(5) "index"
)
parameters
array(0)
57
58 if (!method_exists($controller_name, $method)) {
59 throw new Kohana_404_Exception();
60 }
61
62 call_user_func_array(array(new $controller_name, $method), $args);
63 }
64
65 private static function _reauth_check() {
66 $session = Session::instance();
67 $last_active_auth = $session->get("active_auth_timestamp", 0);
5.
{Appel interne PHP} » Admin_Controller->__call( paramètres )
controller_name
string(10) "clustrmaps"
args
array(0)
6.
SYSPATH/core/Kohana.php[ 331 ] » ReflectionMethod->invokeArgs( paramètres )
object
array(1) (
"private: theme" => NULL
)
args
array(2) (
0 => string(10) "clustrmaps"
1 => array(0)
)
326
327 // Start the controller execution benchmark
328 Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');
329
330 // Execute the controller method
331 $method->invokeArgs($controller, $arguments);
332
333 // Controller method has been executed
334 Event::run('system.post_controller');
335
336 // Stop the controller execution benchmark
7.
{Appel interne PHP} » Kohana_Core::instance( paramètres )
0
NULL
8.
SYSPATH/core/Event.php[ 208 ] » call_user_func_array( paramètres )
function_name
array(2) (
0 => string(6) "Kohana"
1 => string(8) "instance"
)
parameters
array(1) (
0 => NULL
)
203 Event::$data =& $data;
204 $callbacks = Event::get($name);
205
206 foreach ($callbacks as $callback)
207 {
208 call_user_func_array($callback, array(&$data));
209 }
210
211 // Do this to prevent data from getting 'stuck'
212 $clear_data = '';
213 Event::$data =& $clear_data;
9.
APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( paramètres )
name
string(14) "system.execute"
62
63// End system_initialization
64Benchmark::stop(SYSTEM_BENCHMARK.'_system_initialization');
65
66// Make the magic happen!
67Event::run('system.execute');
10.
DOCROOT/index.php[ 102 ] » require( paramètres )
I must mention that i'm using G3 with Greydragon Wind theme.
Any idea what's going wrong?
Thanks.
jofrari
Posts: 2466
Not very ellegant and may require some rework, but it is what it is
just specify your settings, save it and it would not write anything into log
it does not prevent you from using UI, just log is polluted in strict error mode
Posts: 17
Hi Serge,
Not sure i understand your advice!
Where to specify my settings, wich kind of settings
because i can't access the admin area.
Maybe i have to change some file, but again wich one?
Furthermore what you mean by UI...you're a techie and
i'm almost a newbie able to understand if you talk
newbie language.
Thanks again.
jofrari
Posts: 2466
you should not be required to change any files
I'll see what I can do
Posts: 17
Thanks Serge, i'll wait for your advice.
Posts: 2466
version 1.7 released
- simplified validation logic
Posts: 17
Thanks Serge for your imput, but where to download the
latest version because all links are redirecting to the 1.6 version.
Thanks.
jofrari
Posts: 2466
I have corrected the version number in codex page, but it was, in fact, 1.7 version
Posts: 17
Hi Serge,
Thanks a lot, it works perfectly and you'll have some
coffes from me for the time you've spent.
Have a nice day.
jofrari
Posts: 2466
Wonderful ;)
Posts: 48
Hello there
Today i Registred at clustrmaps
The site gave me those 4 codes but all 4 codes doesn't work. (sorry for taking the links and personal data out.)
A] Recommended (good for most users)
<div id="clustrmaps-widget"></div><script type="text/javascript">var _clustrmaps = {'url' : 'http://www.mylink.nl/album', 'user' : 920853, 'server' : '4', 'id' : 'clustrmaps-widget', 'version' : 1, 'date' : '2011-08-15', 'lang' : 'en', 'corners' : 'square' };(function (){ var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'http://www4.clustrmaps.com/counter/map.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);})();</script><noscript><a href="http://www4.clustrmaps.com/user/takenaway"><img src="http://www4.clustrmaps.com/stats/maps-no_clusters/www.mylink.nl-album-thumb.jpg" alt="Locations of visitors to this page" /></a></noscript>
[img]http://ammg.web-chat.eu/clustrmap/A.jpg[/img]
[B] Minimalist (for MySpace and other sites needing the plainest HTML)
<a href="http://www4.clustrmaps.com/user/takenaway"><img src="http://www4.clustrmaps.com/stats/maps-no_clusters/www.mylink.nl-album-thumb.jpg" alt="Locations of visitors to this page" />
</a>
[img]http://ammg.web-chat.eu/clustrmap/B.jpg[/img]
[C] Advanced (for those requiring true W3C XHTML1.1 validation)
<a href="http://www4.clustrmaps.com/counter/maps.php?url=http://www.mylink.nl/album" id="clustrMapsLink"><img src="http://www4.clustrmaps.com/counter/index2.php?url=http://www.mylink.nl/album" style="border:0px;" alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg" />
</a>
<script type="text/javascript">
function cantload() {
img = document.getElementById("clustrMapsImg");
img.onerror = null;
img.src = "http://www2.clustrmaps.com/images/clustrmaps-back-soon.jpg";
document.getElementById("clustrMapsLink").href = "http://www2.clustrmaps.com";
}
img = document.getElementById("clustrMapsImg");
img.onerror = cantload;
</script>
[img]http://ammg.web-chat.eu/clustrmap/C.jpg[/img]
[D] BBcode syntax (for BBCode / Wiki / Last.FM and other sites needing it)
Gives me this
[img]http://ammg.web-chat.eu/clustrmap/D.jpg[/img]
You have [img]http://ammg.web-chat.eu/clustrmap/serge.jpg[/img] on your site. But mine looks different.
On the codex page I saw the following text:
Installation / Configuration
Download module using link above
Unpack Zip and copy it into modules folder
Activate module
New admin menu item would be available under Settings->ClustMaps allowing provide User ID and Site ID associated with the ClustrMaps account.
I only see this on my website. Please tell me what I do wrong
[img]http://ammg.web-chat.eu/clustrmap/clustrmap.jpg[/img]
I'm desperate again
Yours
Tes
Posts: 2466
I have just this
With some small modification, it is option B from the list above
and it looks like it works for you
as it is mentioned on the CM web-site, you need to give it few days before first stats would appear
Posts: 48
Thank you for your answer.
Then I'll give it some time..
I agree, that I'm a bit impatient lately
First I thought it has to do with a free account or a payed account.
I go read more on http://clustrmaps.com/
Thanks again,
Tes
Posts: 48
It worked with code B, then I delete 2 pending users in database and now my gallery is a white index page..
I can access the admin section, but the index page is " gone ".
Dang... Something went wrong!
We tried really hard, but it's broken.
Talk to your Gallery administrator for help fixing this!
Now I have to start all over again....