Index: openacs-4/contrib/packages/irc-logger/tcl/irc-logger-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/irc-logger/tcl/irc-logger-procs.tcl,v
diff -u -r1.9 -r1.10
--- openacs-4/contrib/packages/irc-logger/tcl/irc-logger-procs.tcl 31 May 2004 07:09:14 -0000 1.9
+++ openacs-4/contrib/packages/irc-logger/tcl/irc-logger-procs.tcl 12 Sep 2013 14:38:11 -0000 1.10
@@ -53,6 +53,7 @@
ad_proc -public irc::logger::apply_xslt {
-rdf_log:required
-xsl_style:required
+ {-package_id ""}
} {
Transform the RDF IRC log to HTML using passed XSL stylesheet.
@@ -75,28 +76,41 @@
# Return the empty string if the XSL style could not be applied.
set text ""
+ # Return the empty string if the XSL style could not be applied.
+ set text ""
+
if {![catch {set rdf [dom parse [read [open $rdf_log r]]]} error_msg]} {
if {![catch {set xsl [dom parse [read [open $xsl_style r]]]} error_msg]} {
# Transform the RDF DOM tree to an HTML DOM tree
-
+
if {![catch {set html [$rdf xslt $xsl]} error_msg]} {
# Serialize the HTML DOM tree as HTML text
set text [$html asHTML]
- $html delete
+
} else {
ns_log warning "irc::logger::apply_xslt - Could not transform RDF log '$rdf_log' to HTML with XSL sheet '$xsl_style': $error_msg"
}
- $xsl delete
} else {
ns_log warning "irc::logger::apply_xslt - Could not parse $xsl_style: $error_msg"
}
$rdf delete
} else {
ns_log warning "irc::logger::apply_xslt - Could not parse $rdf_log: $error_msg"
}
+
+ # clean up the dom references, otherwise we have a mem leak.
+ if {[info exists rdf]} {
+ $rdf delete
+ }
+ if {[info exists xsl]} {
+ $xsl delete
+ }
+ if {[info exists html]} {
+ $html delete
+ }
return $text
}
@@ -211,7 +225,9 @@
-xsl_style [parameter::get \
-parameter xsl_stylesheet \
-package_id $package_id \
- -default "[acs_package_root_dir [apm_package_key_from_id $package_id]]/data/default.xsl"]]
+ -default "[acs_package_root_dir [apm_package_key_from_id $package_id]]/data/default.xsl"] \
+ -package_id $package_id]
+
if {![empty_string_p $irc_html_log]} {
# The transformation was succesful. Time to create
@@ -402,9 +418,15 @@
# Locate the first user with a screen name of 'nick' on this
# site. DB caching reduces the number of hits on the DB
# itself.
+
+ # community_member_url was changed to require a conn
+ # it always returned / for the subsite since we run from a
+ # scheduled proc. This needs to be smarter.
+ set community_member_url "[ad_parameter -package_id [ad_acs_kernel_id] CommunityMemberURL]?[export_vars {user_id}]"
+
if {[db_0or1row get_user {}]} {
- set link "$nick"
+ set link "$nick"
} else {
set link $nick
}