Index: openacs.org-dev/packages/irc-logger/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/irc-logger/ChangeLog,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/irc-logger/ChangeLog 30 Jan 2003 00:14:01 -0000 1.1 +++ openacs.org-dev/packages/irc-logger/ChangeLog 4 Feb 2003 19:12:39 -0000 1.2 @@ -1,5 +1,19 @@ -2003-01-29 Bart Teeuwisse +2003-01-31 Bart Teeuwisse - * irc-logger.info (Module): Initial revision - (Module): Bumped up revision to 1.0b (beta) + * www/doc/index.adp (Module): Fixed link to daemontools +2003-01-30 Bart Teeuwisse + + * tcl (Module): + - Shortened the timestamps to allow more space for the conversation. + - Added links to the user accounts who's screen name matches their IRC nick. + - Updated documentation to reflect new features. + - Removed
 tags from XSL sheet as they misfired too often.
+
+
+2003-01-29  Bart Teeuwisse  
+
+	* irc-logger.info (Module): 
+	- Initial revision
+	- Bumped up revision to 1.0b (beta)
+
Index: openacs.org-dev/packages/irc-logger/data/default.xsl
===================================================================
RCS file: /usr/local/cvsroot/openacs.org-dev/packages/irc-logger/data/default.xsl,v
diff -u -r1.1 -r1.2
--- openacs.org-dev/packages/irc-logger/data/default.xsl	30 Jan 2003 00:14:19 -0000	1.1
+++ openacs.org-dev/packages/irc-logger/data/default.xsl	4 Feb 2003 19:13:19 -0000	1.2
@@ -5,8 +5,9 @@
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:wn="http://xmlns.com/wordnet/1.6/"
-  xmlns:foaf="http://xmlns.com/foaf/0.1/">
-
+  xmlns:foaf="http://xmlns.com/foaf/0.1/"
+  xmlns:irc="irc::logger">
+  
   
     
   
@@ -32,13 +33,14 @@
   
 
   
-     GMT
+     GMT
+    []
   
 
   
     
       <
-      
+      
       >
     
   
@@ -63,9 +65,6 @@
         
           
         
-        
-          
-
Index: openacs.org-dev/packages/irc-logger/tcl/irc-logger-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/irc-logger/tcl/irc-logger-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/irc-logger/tcl/irc-logger-procs-postgresql.xql 30 Jan 2003 00:14:44 -0000 1.1 +++ openacs.org-dev/packages/irc-logger/tcl/irc-logger-procs-postgresql.xql 4 Feb 2003 19:13:50 -0000 1.2 @@ -11,4 +11,15 @@ select etp__create_page(:parent_package_id, :date, :date, :content_type) + + + + select u.user_id, p.first_names || ' ' || p.last_name as name + from users u, persons p + where u.screen_name = :nick + and p.person_id = u.user_id + limit 1 + + + Index: openacs.org-dev/packages/irc-logger/tcl/irc-logger-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/irc-logger/tcl/irc-logger-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/irc-logger/tcl/irc-logger-procs.tcl 30 Jan 2003 00:14:44 -0000 1.1 +++ openacs.org-dev/packages/irc-logger/tcl/irc-logger-procs.tcl 4 Feb 2003 19:13:50 -0000 1.2 @@ -218,3 +218,111 @@ -date $gmt_today \ -package_id $package_id } + +namespace eval dom::xpathFunc::irc::logger { + + # The namespace of the tDOM XSLT extension functions for the + # irc-logger module. + +} + +ad_proc -public dom::xpathFunc::irc::logger::user_link { + ctxNode + pos + nodeListType + nodeList + args +} { + +

Create a link to the user account on this site where the IRC + nick matches the user's screen name.

+ +

Rolf (rolf@pointsman.de) from the tDOM team on tDOM extension + functions:

+ +
+

If an XPath expr (both for the selectNodes method and in XSLT + stylesheets) uses a not standard XPath function name (you cannot + 'overwrite' the C coded standard built-in functions), the engine + looks, if there is a tcl proc with the given function name in + the ::dom::xpathFunc:: namespace. In other words: all extension + functions procs must reside in the namespace ::dom::xpathFunc or + in a child namespace of that namespace. If the XPath extension + function has a prefix, the prefix is expanded to the namespace + URI and that namespace URI must be the name of the child + namespace of the ::dom::xpathFunc namespace.

+ +

If there is such a proc, this proc is called with the following + arguments: ctxNode pos nodeListType nodeList args. The 'args' + are, as type/value pairs, the arguments, that are given to the + extension functions. (E.g. if you have + myExtensionFunction('foo'), you will get two args, the first + "string" the second "foo").

+ +

The tcl proc, which implements the extension function must + return a list of two elements: { }. The possible + types at the moment are: "bool", "number", "string", "nodes".

+ +

But don't get confused by my probably (too) vague + explanations. Just look at the examples in the xpath.test and + tdom.tcl files. For almost all 'real life' needs, you should get + it very fast, what to do from that usage examples.

+
+ + @author Bart Teeuwisse (bart.teeuwisse@thecodemill.biz) + @creation-date 2003-01-31 + + @param ctxNode See tDOM documentation. + @param pos See tDOM documentation. + @param nodeListType See tDOM documentation. + @param nodeList See tDOM documentation. + + @param args A single (type, value) pair of type 'attrnodes' with + the nick of the IRC user. + + @return A single (type, value) pair with a link to the user + account on the site. Or just the nick if no user account was found. + + @error The empty string. + +} { + + # Default return value + + set link "" + + # Limited parameter checking. The tDOM related parameters don't + # matter. + + if {[llength $args] == 2} { + + # Get argument type and value. + + foreach {type value} $args { + break + } + + # Check that the parameter an attribute node is and extract + # the value of the attribute. + + if {[string equal $type "attrnodes"]} { + set nick [lindex [lindex $value end] end] + + # Locate the first user with a screen name of 'nick' on this + # site. DB caching reduces the number of hits on the DB + # itself. + + if {[db_0or1row get_user {}]} { + set link "$nick" + } else { + set link $nick + } + } else { + ns_log warning "dom::xpathFunc::irc::logger::user_link wrong parameter type '$type($value)'; type should have been attrnodes" + } + } else { + ns_log warning "dom::xpathFunc::irc::logger::user_link accepts only 1 parameter, received [llength $args] parameters" + } + + return [list string $link] +} Index: openacs.org-dev/packages/irc-logger/www/doc/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/irc-logger/www/doc/index.adp,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/irc-logger/www/doc/index.adp 30 Jan 2003 00:17:02 -0000 1.1 +++ openacs.org-dev/packages/irc-logger/www/doc/index.adp 4 Feb 2003 19:14:50 -0000 1.2 @@ -70,7 +70,7 @@

Place logger under supervision using daemontools or crontab + href="http://cr.yp.to/daemontools.html">daemontools or crontab to guarantee that the bot stays connected to the IRC channel it is logging.

@@ -142,8 +142,13 @@ Edit-This-Page page of the log directly under the instance of Edit-This-Page that @package_name@ is mounted under.

-

@package_name@ can be mounted more than once. Each instance processing the logs of a different bot.

+

@package_name@ can be mounted more than once. Each instance + processing the logs of a different bot.

+

@package_name@ will link to the user's profile and include the + full name for users of the site who have entered their IRC nick as + their OpenACS screen name.

+

Credits

The @package_name@ was designed and written by