Features / Usability

Features / Usability

Encoded email addresses in wiki pages?

posts: 13 Denmark

The "Contact us" feature uses a url encoding mechanism for rendering email addresses in a way that will prevent naïve email harvesting spammer bots from picking up the address.

This is a cool feature, although it can obviously be defeated if the spammers know about it and care to search also for URL-encoded strings---however, an extra encryption and perhaps a ))JavaScript(( browser check could minimise this risk.

Anyway, that's not my main point. My main point is: Can this feature be used when writing wiki pages? Something like (wiki source):

Hi, I am Joe Bloggs. You can reach me at {ENCODE([mailto:joe.bloggs@home.tonite.net])}{ENCODE}

which should produce HTML like

...You can reach me at <scrip type="text/javascript">eval(unescape('...'))</script>

posts: 9 United States

I would like to see this too!

Meanwhile, there are existing plugins that, with a little work, will get you 90% or more of what you want:

  • PluginJS — includes instructions, links to source code, etc.
  • PluginJSFILE — ditto.
  • These are mods, I think they don't come with the standard TikiWiki distro, you have to download and install them on your server.

If they aren't sufficient, I would guess that the best way to do this is to write a TikiWiki plugin just for this purpose. Test it on your own site; when it is solid, propose that it be included in the next distro.

Here are some pages and stuff that will help you write a plugin:

  • WikiPluginDoc. How to use existing plugins - good for background/
  • PluginDev. Starting point for pages on plugin development
  • Attached as wikiplugin_example.php is a template for plugin development. You should be able to get the hang of it if you know PHP and have read WikiPluginDoc and PluginDev. This file normally resides at /lib/wiki-plugins/. You will copy this to something like wikiplugin_encode.php
  • Once you've written enough of your plugin that it can be tested, just upload the file to your server under /lib/wiki-plugins and it will automatically become active.

Hope this helps.

posts: 1092

In the future tikwiki 1.0, there is a feature "Protect email against spam" in a admin-> wiki. But it will work only in a wiki format object. A plugin will not work as the contact page is not wiki parsed.

For the contact page, you can change the template templates/tiki-contact.tpl and use the javascript function that is in tiki1.10 protectEmail in lib/tiki-js.js