Geeky Nuggets

Referrer Wordpress Plugin

September 24, 2004 | 2 Minutes Read

Referrers is a plugin I coded to show the most recent referring urls to a particular post. I had seen the wp-refer plugin from NoPrerequisite but couldn’t put it on my blog without hacking because it uses the meta fields to store its data, and as I display the metadata for other purposes in each post, it would get fairly cluttered.

Also, I am using the very good StatTraq plugin, so I thought I could make use of the fact that it already records referrers.

To install :

  • Download and install Stattraq.
  • Download post_referrers.php.txt
  • Rename to post_referrers.php
  • Or get the gzip file and uncompress it.
  • Upload the resulting file to /wp-content/plugins
  • Activate it in your admin interface

Using it is simple:

Add the following code to your index.php file, within the loop

 post_referrers(8, "<li>", "</li>", "No referrers", "self");

Where ‘8’ is the number of referrers to show, ‘<li>’ is the text to show before each link, ‘</li>’ is the text to showafter each link, ‘No referrers’ is… you guessed it! the text to show when there are no referrers yet and the last option marks the excluded hosts. If you use ‘self’, internal referrers only will be hidden. Otherwise, you can write a list of hosts (domain names) to ignore like this: “google.com yahoo.com example. org” and so on…

See it work at the bottom of this page, and leave a comment in case of problems.

Version 0.21 and up use Google redirection to help prevent referrer spam.

En Fran?ais

Older posts

  • September 19, 2004

    Radio buttons dilemma

    September 19, 2004 | 0 Minutes Read

    What if in a form I select a radio button by mistake, when I didn’t want to make a choice? I guess I would just reload the page, or else hope that the designer put a ‘reset’ button.

  • September 12, 2004

    Jumble Up! Wordpress Plugin

    September 12, 2004 | 2 Minutes Read

    You’ve pbarloby raed taht txet smerwheoe alaerdy :Aoicncdrg to an Enligsh utsinvriey stduy the oedrr of lettres in a wrod desnot mttaer the only tnhig ttahs iatomnrpt is that the fisrt and lsat leettr of evrey wrod is in the crrcoet piotoisn the rest can be jbmeuld and one is siltl albe to read the txet whuoitt dflfciituy.You've pbarloby raed taht txet smerwheoe alaerdy :Aoicncdrg to an Enligsh utsinvriey stduy the oedrr of lettres in a wrod desnot mttaer the only tnhig ttahs iatomnrpt is tha...

  • September 02, 2004

    Stylesheet Chooser Version 0.2

    September 02, 2004 | 2 Minutes Read

    This plugin is deprecated.I had tried for a while to find a way to allow users to choose their favorite theme for this website. I decided to do it as a Wordpress plugin, which I offer today for other Wordpress users.Installing it is quite simple: Download, rename to stylesheet_chooser.php, upload it to your wp-contents/plugins directory and activate it from the admin interface.To define which stylesheets to use (no, it’s not automatic…), you have to define an array called $styles, before you ...

  • August 11, 2004

    Mise l'eau

    August 11, 2004 | 2 Minutes Read

    Ca y est, Salamba a touché son élément !Nous l’avons mis à l’eau a l’occasion du test de flottabilité requis pour l’homologation en cinquième catégorie en tant que voilier insubmersible.Sur la première image, on peut voir le bateau tel qu’il flotte à vide, assez haut sur l’eau par rapport à la ligne de flottaison, ce qui est conforme ce que l’on espérait. Sur la deuxième photo, on voit le bateau chargé avec trois personnes, et la coque principale qui s’enfonce jusqu’a la ligne d...

  • April 13, 2004

    Nouveau projet.

    April 13, 2004 | 1 Minutes Read

    J’ai eu il y a quelques jours une id?e pour un nouveau bateau. Ce serait un trimaran bas? sur un catamaran de sport.Il s’agirait de r?cup?rer un cata d’environ 18 pieds, comme un Nacra 5.5 ou similaire, et de rajouter une coque d’environ 7m 50 entre les deux “flotteurs”. On pourrait sans doute r?utiliser le gr?ement du cata, bien qu’il soit possible que le trimaran, ?tant plus lourd, soit sous-toil?…L’id?al serait de disposer d’un Tornado incomplet, et d’utiliser les coques et le gr?ement pou...