ARC中文动保小百科(APpedia)国际水准的动物保护百科全书 - Url Approvals
主页/关于APpedia - 编辑方法 - 小百科最近更新 - 站内搜索 - 关于动物权利的条目 - 在线咨询

 

ARC中文动保小百科(APpedia)是第一本中文的动物保护百科全书,编辑研究员团队包括海内外杰出的动物保护专家和个人。百科主要以在线方式发布(电子书)并长期扩充改进,是希望成为专业动保工作者、动保学者的朋友的必读材料。百科条目覆盖范围广,学术水平一流,核心条目由编辑团队按重要性选择,并征集研究员编写相应的初稿。所有核心条目发表前均通过质量审核程序,内容以介绍国际最前沿的动物保护知识研究为目标。读者可以自由改进和扩充百科内容。

精彩推荐

以下为主要条目

Share |

Url Approvals

阅读[Url Approvals]最新版本请访问:http://APpedia.arc.capn-online.info Copyright © ARC中文动保小百科
版权说明(转载条目必读) ARC中文动保小百科邮件地址:
APpedia@arc.capn-online.info
分类 浏览全部完成的百科条目:http://APpedia.arc.capn-online.info/all

This page explains how to discourage "link spamming" on your wiki site using PmWiki's urlapprove.php script.

Using urlapprove.php

Occasionally spammers may try to add large number of (sometimes hidden) URLs to pages because they think it will improve their search engine rankings -- which it probably won't. The urlapprove.php script works against these spammers' purpose by

  • requiring approval of Internet sites before a link to them are created in the wiki, and
  • allowing you to limit the number of unapproved links that may be added to a page.

To enable urlapprove.php, add the following line to a configuration file:

include_once('scripts/urlapprove.php');

By default, unapproved links display a (approve sites) link instead of the unapproved link. A click on the link will approve all unapproved URLs on the page, but only if you are authorized to edit the Site.ApprovedUrls page. You may also pre-approve sites by by adding them to the Site.ApprovedUrls page.

Limiting unapproved urls per page

You can limit the number of unapproved links per page. If the limit is exceeded, the page cannot be saved. This is useful because spammers like to write long link lists, which is rare for normal authors.

Example: To set the limit to 5 unapproved links, add the following line to a configuration file:

$UnapprovedLinkCountMax = 5;
include_once('scripts/urlapprove.php');

Note that $UnapprovedLinkCountMax must be set before including the urlapprove.php script.

Handling of Unapproved Links

You can also change the disapproval message defined in the $UnapprovedLinkFmt variable, for example:

include_once('scripts/urlapprove.php');
$UnapprovedLinkFmt =
 "[$[Link requires approval]]<a class='apprlink'
  href='\$PageUrl?action=approvesites'>$[(approve)]</a>";

If you wish to totally forbid unapproved links you can use

$UnapprovedLinkFmt = "<b>external link not allowed</b>";

SideBar caveat

Please note that in general you need to go to the sidebar page in order to approve links in the sidebar. The reason for this is that the approve mechanism only approves links on the current page.

Initial setup

After initial setup all existing links become un-approved. To find out which pages are affected one can use an RSS feed on AllRecentChanges. All pages with unappreved links will show up there.

Technical tips

Urls are approved by adding them to a "white list", defined in the variable $WhiteUrlPatterns, which is set in the local/config.php file.
To add multiples urls, use the separator | (vertical bar). For example:

$WhiteUrlPatterns =
  "http://example.com/|http://example.net/|http://example.org/";

To add all urls from, say New Zealand and Australia, use:

$WhiteUrlPatterns[] = 'http://[^/] \\.nz';
$WhiteUrlPatterns[] = 'http://[^/] \\.au';

If you want to change the default name of this Site.ApprovedUrls write in local/config.php (after the script inclusion line):

$ApprovedUrlPagesFmt = array('OtherGroup.OtherName');

Generally, it might be

array('$DefaultGroup.ApprovedUrls');

To see what link is to be approved without editing the page a tool tip can be displayed when the cursor hovers over the (approve Links) link that displays the URL. e.g. Example

Add the following setting in your local/config.php:

$UnapprovedLinkFmt =
  "\$LinkText<a class='apprlink' href='\$PageUrl?action=approvesites'
   title='\$LinkUrl'>$[(approve sites)]</a>";

About rel='nofollow'

By default, PmWiki creates external links that are not followed by search engines. Here are release notes from pmwiki-2.0.beta20 (30-Jan-2005):

First, the $UrlLinkFmt variable has been modified so that links to external urls automatically have a rel='nofollow' attribute added to them, to help combat wiki spam as described in http://googleblog.blogspot.com/2005/01/preventing-comment-spam.html. Site administrators can customize $UrlLinkFmt and $UnapprovedLinkFmt to supply or omit rel='nofollow' as appropriate.

See Also

<< RefCount? | Documentation Index | Variables >>

主页(关于ARC中文动保小百科) - 编辑使用手册 - 小百科最近更新 - 在小百科内搜索(使用Google)
本文最后更新于 2006 年 07 月 22 日, 12:14 上午

Animal Rights, New Welfarism, Reverence for Animals, Animal Welfare, Naturalness, Autonomy of Animals, Animal Experimentation, Wildlife Protection, Spiritual Power of Animals, and more...

free stats