[Pmwiki-users] Preventing "comment spam"

Patrick R. Michaud pmichaud at pobox.com
Mon Jan 31 08:55:52 CST 2005


On Mon, Jan 31, 2005 at 11:20:32AM +0000, Hans wrote:
> Wednesday, January 19, 2005, 5:32:31 PM, Patrick wrote:
> > 1. rel="nofollow" for all external links (new default for beta20)
> >    $UrlLinkFmt = 
> >      "<a class='urllink' href='\$LinkUrl' rel='nofollow'>\$LinkText</a>";
> > 2. rel="nofollow" for unapproved external links only
> >    $UnapprovedLinkFmt =
> >      "<a class='apprlink' href='\$LinkUrl' rel='nofollow'>\$LinkText</a>";
> > 3. no rel="nofollow" at all (default for beta19 and earlier)
> >    $UrlLinkFmt = 
> >      "<a class='urllink' href='\$LinkUrl'>\$LinkText</a>";
> > 4. not linking unapproved external links at all
> >    $UnapprovedLinkFmt = "\$LinkText";
> [..]
> If one has urlapproval implemented via
>    include_once('scripts/urlapprove.php');
> then an unapproved link is not really a link, it is only followed by
> an "approve sites" link, which will trigger action=approvesites.
> So what is the point of $UnapprovedLinkFmt?

If one has url approvals implemented via 
include_once('scripts/urlapprove.php'), then unapproved links
are generated using $UnapprovedLinkFmt instead of $UrlLinkFmt.
By default $UnapprovedLinkFmt is set to display the "approve sites"
link, but this isn't a requirement -- a site administrator could
easily set it for a different policy.

One policy (#4 above) would be to disallow unapproved links entirely, by
setting $UnapprovedLinkFmt = "\$LinkText".  The url would still display
in the output, but not be a link until someone (manually) added the url's
site to the Main.ApprovedUrls page.

Another policy (#2 above) would be to have unapproved links displayed as 
links with the rel='nofollow' attribute, and approved links displayed as links
without rel='nofollow'.  Thus:

  include_once('scripts/urlapprove.php');
  $UnapprovedLinkFmt = "<a rel='nofollow' class='unapprovedlink' 
    href='\$LinkUrl'>\$LinkText</a>";
  $UrlLinkFmt = "<a class='urllink' href='\$LinkUrl'>\$LinkText</a>";

Again, links would appear as unapproved links until someone manually
added a site to the Main.ApprovedUrls page.

The point is that almost any desired policy can be obtained via judicious
settings of $UnapprovedLinkFmt and $UrlLinkFmt.

> It seems to me that if I have urlapproval implemented and I wish to
> have search bots follow the url links then I need to add to config.php
> point 3:
>    $UrlLinkFmt = "<a class='urllink' href='\$LinkUrl'>\$LinkText</a>";
> the pre-beta 20 default.

Yes, this is correct -- sorry if I missed that point.

Pm



More information about the pmwiki-users mailing list