Pluglink, a tiny yet powerful Joomla plugin
Pluglink, a tiny yet powerful Joomla plugin - Examples and changelog Print E-mail
Wednesday, 24 June 2009 23:28
Article Index
Pluglink, a tiny yet powerful Joomla plugin
Examples and changelog
All Pages

Examples

The "%" characters after "{" are only present in those examples so that the plugin markups will be ignored on this page... All the example plugin markups are also present whithout "%" in this article. The links introduced around the example expressions are thereby genuine Pluglink's links...

Use with text

{%pluglink text="Homepage" link="index.php" case="1" popup="1"}

homepage

Homepage.

Here the plugin will place links around each occurences of "Homepage" but not "homepage" and the link will be opened in a new window... Note that the plugin does not care about the context (quotes) of each occurence.

Use with regex

{%pluglink regex="/(whateverurl\.ext[^\/:])/i" link="http://www.whateverurl.ext/"}

whateverurl.ext?

http://www.whateverurl.ext/

http://www.whateverurl.ext:97/

In this example, using "regex" allows to select the context where whateverurl.ext is linked. Note that the question mark in whateverurl.ext? is also linked as it is part of the expression. The expression in the regex delimiter "/"needs to be put in parentheses.

Use of additional parentheses in regex

{%pluglink regex="/((otherurl\.ext)[^\/:])/i" link="http://www.otherurl.ext/"}

otherurl.ext?

http://www.otherrurl.ext/

Here the second set of parenthesis (inside the outermost parentheses) delimits the expression that will be linked by the plugin. The question mark in "otherurl.ext?" will not be linked.

It is possible to use a third set of parenthesis. The best explanation is given through the following example:

{%pluglink regex="/(((yetanotherone\.ext)%l))/i" link="http://www.yetanotherone.ext/"}

yetanotherone.ext (Here "%l" has been introduced after yetanotherone.ext)

yetanotherone.ext (While here it was not)

The first set of parenthesis delimits, as in the other examples, the whole expression in the "/" regex delimiters. The second set delimits the expression that will be removed from the text and replaced by the expression inside the third set of parenthesis around which the link will be placed. In our example this results in the removal of "%l" after "yetanotherone.ext".

This allows to easily direct Pluglink at specific occurences of your regular expression whithout changing the final output of your text.

Changelog

1.5.0 (24/06/2009) - First version of Pluglink (for Joomla! 1.5.x native)

  • Platform switch from Joomla! 1.0.x to 1.5.x native
  • Partial rewriting for better perfomances

0.2.0 (24/01/2008) - Last version of Bot link (for Joomla 1.0.x)

  • Avoidance of HTML markups and special characters (activated by default and options to disable).
  • Support for escaped quotes (\") in arguments.
  • Implementation of the "alt" argument.
  • Implementation of tooltips.
  • Improved processing of the default bots.

0.1.3 (10/01/2008)

  • Minor bugs fixed.

0.1.2 (10/01/2008)

  • Introduction of the "class" argument.

0.1.1 (09/01/2008)

  • Implementation of PHP4 unsupported functions.

0.1.0 (06/01/2008)

  • First release of Bot link (for Joomla 1.0.x)

P.S.

I hope every user will like this tiny plugin. I offer no warranty of the fitness of my code and you must use it at your own risks... Don't hesitate to contact me about whatever bug you might find or whatever improvement you think I could bring to this bit of code...



Comments
Search
admin  - Nice   |2009-08-13 00:12:11
Interesting. Have been looking for a autolink-plugin. In Joomla 1.0 I used kodamera autolinker but unfortunately it doens't work in J1.5

With pluglink I have one big problem. I don't see an option to link a certain word or phrase just once on a page. For example: if you link the word dog to a specific page and the page is full of the word dog, the links are all around. Just one automatic link would be enough
Only registered users can write comments!

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Tuesday, 07 July 2009 11:37