libs/PHPCrawler.class.php
function addLinkPriority($regex, $level)
  {
    $check = PHPCrawlerUtils::checkRegexPattern($regex); // Check pattern
    if ($check == true && preg_match("/^[0-9]*$/", $level))
    {
      $c = count($this->link_priority_array);
      $this->link_priority_array[$c]["match"] = trim($regex);
      $this->link_priority_array[$c]["level"] = trim($level);
    
      return true;
    }
    else return false;
  }
function addLinkPriority($regex, $level)
  {
    $check = PHPCrawlerUtils::checkRegexPattern($regex); // Check pattern
    if ($check == true && preg_match("/^[0-9]*$/", $level))
    {
      $c = count($this->link_priority_array);
      $this->link_priority_array[$c]["match"] = trim($regex);
      $this->link_priority_array[$c]["level"] = trim($level);
    
      return true;
    }
    else return false;
  }
Adds a regular expression togehter with a priority-level to the list of rules that decide what links should be prefered.

Links/URLs that match an expression with a high priority-level will be followed before links with a lower level.
All links that don't match with any of the given rules will get the level 0 (lowest level) automatically.

The level can be any positive integer.

<b>Example:</b>

Telling the crawler to follow links that contain the string "forum" before links that contain ".gif" before all other found links.
<code>
$crawler->addLinkPriority("/forum/", 10);
$cralwer->addLinkPriority("/\.gif/", 5);
</code>

@param string $regex  Regular expression definig the rule
@param int    $level  The priority-level

@return bool  TRUE if a valid preg-pattern is given as argument and was succsessfully added, otherwise it returns FALSE.
@section 10 Other settings