Active
Project:
URL Proxy
Version:
6.x-1.0
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2008 at 13:14 UTC
Updated:
18 Aug 2008 at 13:22 UTC
Hi,
I haven't dug deep in your code, but the structure of the table fitted my needs. However, I wanted to track the clicks without having to use the API, so I added a few small things to do the job using JQuery.
I added the following to urlproxy.module:
drupal_add_js(drupal_get_path('module', 'urlproxy') .'/urlproxy.js');
/**
* Record clicks using Javascript
*/
function urlproxy_js_click() {
if ($_GET['url']) {
global $user;
urlproxy_add_hit('general', urldecode($_GET['url']), NULL, urldecode($_GET['referer']), 'urlproxy', array('type' => 'general', 'user' => $user));
}
exit;
}
And created the new file urlproxy.js with the following contents:
// Javascript Document
Drupal.behaviors.urlproxy = function(context) {
$("a").click(
function() {
$.get('/proxy/click/?url=' + Drupal.encodeURIComponent(this.href) + '&referer=' + Drupal.encodeURIComponent(document.referrer), null, null);
}
);
}
This records all clicks on the site (if the client has javascript enabled)... Feel free to implement it in some way if you wish to. It could be selected as an optional tracking-method on a config page or something....
Cheers!
| Comment | File | Size | Author |
|---|---|---|---|
| urlproxy.js_.txt | 264 bytes | 2xe |
Comments
Comment #1
2xe commentedAh... and the menu:
And if you wish to skip the admin folder: