On 02/05/05, Brion Vibber <brion(a)pobox.com> wrote:
Edward Z. Yang wrote:
Current behavior of Redirects totally masks any
text that comes after
the #REDIRECT [[]] declaration.
The main reason this is done is that extra text containing links will
foul up the link database: the single outgoing link from a redirect is
used to keep track of where that redirect leads to.
Redirect pages really oughtn't to be stored the way they are, it's a
nasty hack. This should be recorded properly as metadata listing the
exact target as a cleanly machine-readable field.
This was why - although I explained it very badly - I posited a
"l_is_redirect" field when I outlined a possible structure for a
combined links table. [1] On further thought, it would possibly be
simpler to have it as just another link type - alongside LT_NORMAL,
LT_CATEGORY, LT_IMAGE, etc, you could have an LT_REDIRECT which marked
out the one specific link which designated the target for that
redirect.
The idea being that, on loading the page record and spotting the
page_is_redirect flag, a lookup could be made for (pardon if this is
hideously bad SQL, but you get the idea I hope) "SELECT l_to_ns,
l_to_title WHERE l_from=$id l_type=LT_REDIRECT" and be guaranteed to
get the destination, without needing to ban other links from the
redirect page.
I had originally wondered whether a link could be, for instance, a
categorylink *and* a redirect destination, but it's probably better if
that's *not* the case. I had an idea, for instance, that a category
redirecting to another category should act as an "alias" when
determining the category's membership (this would allow categories to
be renamed without changing all references to them); but I'm not sure
now whether having the redirect flag distinct from the link_type would
make that any easier.
Ref:
[1]
http://mail.wikimedia.org/pipermail/wikitech-l/2005-March/027957.html
--
Rowan Collins BSc
[IMSoP]