--- project_issue.module.bak 2007-12-02 22:11:28.000000000 +0100 +++ project_issue.module 2007-12-02 22:11:39.000000000 +0100 @@ -149,6 +149,16 @@ function project_issue_settings_form() { ); } + $form['project_issues_min_link'] = array( + '#title' => t('Minimum issue id'), + '#type' => 'textfield', + '#default_value' => variable_get('project_issues_min_link', 0), + '#size' => 6, + '#maxlength' => 10, + '#description' => t('Issue ids below this number wont turn into links.'), + '#validate' => array('project_issue_validate_min_link' => array()), + ); + return system_settings_form($form); } @@ -161,6 +171,12 @@ function project_issue_validate_issues_p } } +function project_issue_validate_min_link($form) { + if (!is_numeric($form['#value'])) { + form_error($form, t('%setting must be a number.', array('%setting' => t('Minimum issue id')))); + } +} + function project_issue_cron() { if (time() - variable_get('project_issue_digest_last', 0) > variable_get('project_issue_digest_interval', 7 * 24 * 60 * 60)) { variable_set('project_issue_digest_last', time()); @@ -927,6 +943,7 @@ function project_release_filter($op, $de case 'prepare': return $text; case 'process': + $minnid = variable_get('project_issues_min_link',0); $regex = '(#\d+)'; $regex = '(?|\w)'; $offset = 0; @@ -935,7 +952,7 @@ function project_release_filter($op, $de $offset++; $nid = substr($match[0],1); $node = node_load($nid); - if (is_object($node)) { + if (is_object($node) && $node->nid>=$minnid) { $link = theme_project_issue_issue_link($node); $text = substr_replace($text, $link, $match[1], strlen($match[0])); $offset = max($offset, $match[1]+strlen($link));