[geeklog-devel] Idea for next 1.3.x

LIMBURG, Mark mark.limburg at baesystems.com
Sun Mar 9 19:27:36 EST 2003


Howdy,

Autolinks as per postnuke.

In essence, the concept is fairly simple.  The admin creates a bunch of
'text' which is automatically altered to become a link.  Let's go with an
example.

Text: Google
Link: http://www.google.com/
Title: The Google Search Engine

Whenever the word 'google' appears, it's replaced with:

  <a href="http://www.google.com/" title="The Google Search Engine"
class="autolink">Google</a>

Now the annoying bit.  We'll need to ensure that the autolink does NOT occur
when it shouldn't.  The best example I can think of is if the word is
already inside a link.  This would be annoying:

  <a href="http://www.<a href="http://www.google.com/" title="The Google
Search Engine" class="autolink">Google</a>.com/">Go</a>

Now, you *could* use a space pattern match, so only " google " would be
valid, but that doesn't fix a bunch of problems also.  The follow shows this
..

 <a href="http://sitename.com">My <a href="http://www.google.com/"
title="The Google Search Engine" class="autolink">Google</a> Statistics</a>

.. not to mention " google." and the like.  

So, I think we'd need to do some pattern parsing.  If the term is inside a
<a> then it doesn't apply.  If my brain was actually online (I'm writing
this from notes I made on the weekend) I'm sure I could think of a few more.

As an additional extra, these links would appear in the 'whats releated'
section of a story.

Thoughts?  Is this something people want?

Regards,

Mark Limburg
Team Leader, Unix Operations, Information Systems

BAE SYSTEMS, AUSTRALIA
PO Box 1068, Salisbury
South Australia,  5108
Phone: +61 8 8480 7971
Fax:   +61 8 8480 8866
Mobile:+61 4 0448 0599




More information about the geeklog-devel mailing list