[interchange-cvs] interchange - jon modified code/UserTag/history_scan.tag

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Thu Apr 8 22:45:32 EDT 2004


User:      jon
Date:      2004-04-09 02:45:31 GMT
Modified:  code/UserTag history_scan.tag
Log:
Add "include" option that is a regex specifying which pages will be
included. It is the opposite of "exclude" but both can be used together
(with exclude having precedence).

Revision  Changes    Path
1.14      +7 -0      interchange/code/UserTag/history_scan.tag


rev 1.14, prev_rev 1.13
Index: history_scan.tag
===================================================================
RCS file: /var/cvs/interchange/code/UserTag/history_scan.tag,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -u -r1.13 -r1.14
--- history_scan.tag	25 Mar 2004 17:03:54 -0000	1.13
+++ history_scan.tag	9 Apr 2004 02:45:31 -0000	1.14
@@ -1,3 +1,4 @@
+UserTag history-scan Version 0.10
 UserTag history-scan Order find exclude default
 UserTag history-scan addAttr
 
@@ -14,6 +15,7 @@
 
 	default=      Page to return if nothing else matches
 	exclude=      A RegEx of page names to skip
+	include=      A RegEx of only page names allowed
 	form=         Additional form parameters
 	pageonly=1    Return just the name of a page, not a link to it.
 	count=#N      Skip the #N most recently visited pages
@@ -77,9 +79,14 @@
 	}
 	my ($hist, $href, $cgi);
 	$exclude = qr/$exclude/ if $exclude;
+	my $include;
+	$include = qr/$opt->{include}/ if $opt->{include};
 	for (my $i = $#$ref - abs($opt->{count}); $i >= 0; $i--) {
 		next if $ref->[$i][0] eq 'expired';
 		if ($exclude and $ref->[$i][0] =~ $exclude) {
+			next;
+		}
+		if ($include and $ref->[$i][0] !~ $include) {
 			next;
 		}
 		if($find) {








More information about the interchange-cvs mailing list