@joubertredrat opened this issue on July 11th 2016

Hi guys, When I'm on indexVisitorLog action, I copy IP and paste in other site to see other IP informations (rDNS, location, blacklists, etc).

So I had an idea, why not set a optional link on IP to open in other sites?

Example: If i set on config url with ip joker, ip will have link to open, as examples below: http://www.tcpiputils.com/browse/ip-address/{$ip} https://mxtoolbox.com/SuperTool.aspx?action=blacklist%3a{$ip}&run=toolpage https://db-ip.com/{$ip}

If you not set config url, indexVisitorLog will display IP only a text, as it is today.

What you think guys?

@mattab commented on July 11th 2016

Hi @joubertredrat - thanks for the suggestion. our thoughts on this will be more around creating a new small plugin (published on the marketplace) that would let people, in the Plugin settings area, easily choose one of a pre-existing list of IP data websites, or input their own custom link. It would be awesome to have such new plugin!

@joubertredrat commented on July 12th 2016

Hi @mattab, if is possible to make this as plugin, I will provide this then :+1:

@mattab commented on July 12th 2016

@joubertredrat sounds good! let us know if you manage to create this plugin :+1:

@hpvd commented on July 12th 2016

+1

@joubertredrat commented on July 14th 2016

Hi guys,

@mattab the plugin is almost ready, as you can see on https://github.com/joubertredrat/Piwik-LinkForIP but I have little question about template.

On template, visitIp isn't escaped with raw, then is display as string, as image below:

If I add raw on variable (IP: {{ visitor.getColumn('visitIp')|raw }}) in template, works fine:

Then a question, have one alternative to don't scape data without raw or really will necessary a PR with this change if is allowed?

~~Other alternative is javascript, get string into span, regex to get IP and add bind click, but I think that isn't good idea.~~

@mattab commented on July 15th 2016

Hi @joubertredrat - I think in this case, maybe it works easier if we add a class to the STRONG containing the IP address. Then you could get & change in this element and add the <a href=..>...</a> in JavaScript dynamically. Maybe you could make a PR changing the <strong element showing the IP to be a SPAN with a special class?

@joubertredrat commented on July 15th 2016

Hi @mattab I really don't think that is good to use javascript because it can broken browser if have a lot of lines, javascript to manipulate elements after DOM loaded consumes a lot of memory and have other possible problem, on pagination or data reload, will be necessary manipulate again by javascript.

I will test to see if is possible using data html atribute data-ip='x.x.x.x' on span and bind with click and open url by ip defined on data-ip value.

Another way is instead IP: {{ visitor.getColumn('visitIp')|raw }}, create other filter and use on template, IP: {{ visitor.getColumn('visitIp')|url_ip }} but I'm not good with Twig, I don't know if is easy to make this.

http://twig.sensiolabs.org/doc/advanced.html#filters

@mattab commented on July 19th 2016

I will test to see if is possible using data html atribute data-ip='x.x.x.x' on span and bind with click and open url by ip defined on data-ip value.

This also sounds pretty good solution! let us know

@joubertredrat commented on October 18th 2016

Hi guys,

@mattab sorry for delay, a lot of work here :( I tried with data-bind, but without success. Then I can talk with you if have problems to changes in twig as above.

Powered by GitHub Issue Mirror