Index: openacs-4/packages/lars-blogger/lib/blog-titles.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/lib/blog-titles.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/lars-blogger/lib/blog-titles.tcl	24 Feb 2005 13:33:21 -0000	1.2
+++ openacs-4/packages/lars-blogger/lib/blog-titles.tcl	30 Oct 2013 17:37:08 -0000	1.3
@@ -28,20 +28,20 @@
 
 set blog_name [lars_blog_name -package_id $package_id]
 
-if { [ad_conn isconnected] && ![string equal $package_url [string range [ad_conn url] 0 [string length $package_url]]] } {
+if { [ad_conn isconnected] && $package_url ne [string range [ad_conn url] 0 [string length $package_url]] } {
     set blog_url $package_url
 } else {
     set blog_url {}
 }
 
-if { [exists_and_not_null max_num_entries] } {
+if { [info exists max_num_entries] && $max_num_entries ne "" } {
     # MaxNumEntriesOnFrontPage parameter is set, which means we should limit to that
     set limit $max_num_entries
 } else {
     set limit ""
 }
 
-if { [exists_and_not_null num_days] } {
+if { ([info exists num_days] && $num_days ne "") } {
     # NumDaysOnFrontPage parameter is set, which means we should limit to that
     set date_clause [db_map date_clause_default]
 } else {
@@ -52,7 +52,7 @@
 
 db_multirow -extend {permalink_url} titles blog-titles "" {
 
-    if {$limit != ""} {
+    if {$limit ne ""} {
 	if {$output_rows_count >= $limit} {break}
     }
 
Index: openacs-4/packages/lars-blogger/lib/last-n-comments.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/lib/last-n-comments.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lars-blogger/lib/last-n-comments.tcl	13 Dec 2003 20:06:14 -0000	1.1
+++ openacs-4/packages/lars-blogger/lib/last-n-comments.tcl	30 Oct 2013 17:37:08 -0000	1.2
@@ -1,6 +1,6 @@
 set package_id [ad_conn package_id]
 
-if { ![exists_and_not_null number_of_comments] || $number_of_comments == 0 } {
+if { ![info exists number_of_comments] || $number_of_comments eq "" || $number_of_comments == 0 } {
     set number_of_comments [parameter::get \
                                 -default 10 \
                                 -parameter NumberOfCommentsInIncludelet]
Index: openacs-4/packages/lars-blogger/tcl/blogger-api-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/blogger-api-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/lars-blogger/tcl/blogger-api-procs.tcl	12 Jul 2004 11:33:19 -0000	1.6
+++ openacs-4/packages/lars-blogger/tcl/blogger-api-procs.tcl	30 Oct 2013 17:37:08 -0000	1.7
@@ -30,7 +30,7 @@
                             -password $password]
     }
 
-    if { $auth(auth_status) != "ok" } {
+    if { $auth(auth_status) ne "ok" } {
         return -code error $auth(auth_message)
     }
 
Index: openacs-4/packages/lars-blogger/tcl/category-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/category-procs.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/lars-blogger/tcl/category-procs.tcl	29 Dec 2003 21:54:27 -0000	1.4
+++ openacs-4/packages/lars-blogger/tcl/category-procs.tcl	30 Oct 2013 17:37:08 -0000	1.5
@@ -16,13 +16,13 @@
     set creation_user [ad_conn user_id]
     set creation_ip [ns_conn peeraddr]
 
-    if { [empty_string_p $category_id] } {
+    if { $category_id eq "" } {
         set category_id [db_nextval acs_object_id_seq]
     }
-    if { [empty_string_p $package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
-    if { [empty_string_p $short_name] } {
+    if { $short_name eq "" } {
         set existing_short_names [lars_blogger::category::get_existing_short_names -package_id $package_id]
         set short_name [util_text_to_url -existing_urls $existing_short_names -text $name]
     }
Index: openacs-4/packages/lars-blogger/tcl/entry-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/entry-procs.tcl,v
diff -u -r1.25 -r1.26
--- openacs-4/packages/lars-blogger/tcl/entry-procs.tcl	16 Oct 2006 18:06:33 -0000	1.25
+++ openacs-4/packages/lars-blogger/tcl/entry-procs.tcl	30 Oct 2013 17:37:08 -0000	1.26
@@ -21,7 +21,7 @@
     set creation_user [ad_conn user_id]
     set creation_ip [ns_conn peeraddr]
 
-    if { [empty_string_p $package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
 
@@ -107,7 +107,7 @@
     {-no_update:boolean}
     {-redirect_url ""}
 } {
-    if { [empty_string_p $package_id] } {
+    if { $package_id eq "" } {
 	# can't just use ad_conn package_id since the 
 	# request may be coming via XML-RPC
 	lars_blogger::entry::get -entry_id $entry_id -array entry
@@ -121,7 +121,7 @@
         lars_blog_flush_cache
     }
     
-    if { ![empty_string_p $redirect_url] } {
+    if { $redirect_url ne "" } {
         ad_returnredirect $redirect_url
         ns_conn close
     }
@@ -224,7 +224,7 @@
 
     append new_content "$blog_name: $blog_url<p>"
 
-    if { ![empty_string_p $blog(title_url)] } {
+    if { $blog(title_url) ne "" } {
         append new_content "<a href=\"$blog(title_url)\">$blog(title)</a>"
     } else {
 	append new_content "$blog(title)"
Index: openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl,v
diff -u -r1.27 -r1.28
--- openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl	11 Sep 2013 07:23:42 -0000	1.27
+++ openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl	30 Oct 2013 17:37:08 -0000	1.28
@@ -11,11 +11,11 @@
     -user:boolean
     {-package_id ""}
 } {
-    if { [empty_string_p $package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
     
-    set timeout [expr 30*60]
+    set timeout [expr {30*60}]
     set channel_title [lars_blog_name -package_id $package_id]
     set creation_user [ad_conn user_id]
     set creation_ip [ns_conn peeraddr]
@@ -26,15 +26,15 @@
         # check whether there's been a channel setup for this instance
         set summary_context_id [db_string select_instance_channel {} -default {}]
             
-        if { [empty_string_p $summary_context_id] } {
+        if { $summary_context_id eq "" } {
             # Setup a channel for this instance
             set summary_context_id [db_exec_plsql create_instance_channel {}]
         }
         
         # check whether there's been a feed setup for this instance
         set subscr_id [db_string instance_feed_subscr_id {} -default {}]
         
-        if { [empty_string_p $subscr_id] } {
+        if { $subscr_id eq "" } {
             # Setup an RSS feed for this instance
             set channel_link [lars_blog_public_package_url]
             
@@ -50,18 +50,18 @@
         # check whether there's been a channel setup for this instance
         set summary_context_id [db_string select_user_channel {} -default {}]
 
-        if { [empty_string_p $summary_context_id] } {
+        if { $summary_context_id eq "" } {
             # Setup a channel for this instance
             set summary_context_id [db_exec_plsql create_user_channel {}]
         }
 
         # check whether there's been a feed setup for this user
         set subscr_id [db_string user_feed_subscr_id {} -default {}]
 
-        if { [empty_string_p $subscr_id] } {
+        if { $subscr_id eq "" } {
             set screen_name [acs_user::get_element -user_id $creation_user -element screen_name]
             
-            if { ![empty_string_p $screen_name] } {
+            if { $screen_name ne "" } {
                 # Setup an RSS feed for the user
                 set channel_link "[lars_blog_public_package_url]user/$screen_name/"
                 
@@ -71,7 +71,7 @@
                 ns_log Warning "lars-blogger: User $creation_user has no screen_name, cannot setup an RSS feed for user"
             }
         }
-        if { ![empty_string_p $subscr_id] } {
+        if { $subscr_id ne "" } {
             # Run it now
             # rss_gen_report $subscr_id
         }
@@ -88,7 +88,7 @@
 
 
 ad_proc -public lars_blog_get_as_string { 
-    -package_id
+    {-package_id ""}
     -url
     {-display_template /packages/lars-blogger/www/blog}
 } {
@@ -100,7 +100,7 @@
     display_template is what to use to render the blog (instead of
     the default blog.adp).
 } { 
-    if { ![exists_and_not_null package_id] } {
+    if { $package_id eq "" } {
         array set blog_site_node [site_node::get -url $url]
         set package_id $blog_site_node(object_id)
     }
@@ -111,17 +111,17 @@
 ad_proc lars_blog_flush_cache {
     {package_id ""}
 } {
-    if { [empty_string_p $package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
     # Flush both admin and non-admin version
     util_memoize_flush_regexp "lars_blog_get_as_string_mem $package_id"
 }
 
 ad_proc -public lars_blog_public_package_url {
-    -package_id
+    {-package_id ""}
 } {
-    if { ![exists_and_not_null package_id] } {
+    if { $package_id eq "" } {
         # No package_id given, so we'll just use ad_conn
         set package_id [ad_conn package_id]
         set default_url [ad_conn package_url]
@@ -138,37 +138,37 @@
 }
 
 ad_proc -public lars_blog_name { 
-    -package_id
+    {-package_id ""}
 } {
-    if { ![exists_and_not_null package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
     array set site_node [site_node::get_from_object_id -object_id $package_id]
     return $site_node(instance_name)
 }
 
 ad_proc -public lars_blog_header_background_color {
-    -package_id
+    {-package_id ""}
 } {
-    if { ![exists_and_not_null package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
     return [ad_parameter -package_id $package_id "HeaderBackgroundColor" "lars-blogger" "#dcdcdc"] 
 }
 
 ad_proc -public lars_blog_categories_p {
-    -package_id
+    {-package_id ""}
 } {
-    if { ![exists_and_not_null package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
     return [ad_parameter -package_id $package_id "EnableCategoriesP" "lars-blogger" "1"]
 }
 
 ad_proc -public lars_blog_stylesheet_url {
-    -package_id
+    {-package_id ""}
 } {
-    if { ![exists_and_not_null package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
     return [parameter::get -package_id $package_id -parameter "StylesheetURL" -default "/resources/lars-blogger/lars-blogger.css"] 
@@ -187,39 +187,39 @@
 }
 
 ad_proc -public lars_blogger::count {
-    -package_id
+    {-package_id ""}
 } {
     @return the number of published blog entries in the package.
 } {
-    if { ![exists_and_not_null package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
     return [db_string entry_count {}]
 }
 
 
 ad_proc -public lars_blogger::get_rss_file_url {
-    -package_id
-    -screen_name
+    {-package_id ""}
+    {-screen_name ""}
 } {
     @param package_id The package_id of the lars-blogger instance. Defaults to current package.
     
     @param screen_name If specified, returns the RSS feed for just that user's postings.
     
     @return The URL of the RSS feed.
 } {
-    if { ![exists_and_not_null package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
 
     set rss_file_url {}
     
     set rss_file_name [parameter::get -parameter "rss_file_name" -package_id $package_id]
 
-    if { ![empty_string_p $rss_file_name] } {
+    if { $rss_file_name ne "" } {
         set package_url [lars_blog_public_package_url -package_id $package_id]
 
-        if { [exists_and_not_null screen_name] } {
+        if { $screen_name ne "" } {
             set rss_file_url "${package_url}user/$screen_name/rss/$rss_file_name"
         } else {
             set rss_file_url "${package_url}rss/$rss_file_name"
Index: openacs-4/packages/lars-blogger/tcl/metaweblog-api-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/metaweblog-api-procs.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/lars-blogger/tcl/metaweblog-api-procs.tcl	12 Jul 2004 11:33:19 -0000	1.5
+++ openacs-4/packages/lars-blogger/tcl/metaweblog-api-procs.tcl	30 Oct 2013 17:37:08 -0000	1.6
@@ -63,11 +63,11 @@
 
     set entry_id [db_nextval t_acs_object_id_seq]
 
-    if { ![exists_and_not_null content(title)] } {
+    if { ![info exists content(title)] || $content(title) eq "" } {
         set content(title) " "
     }
     
-    if { ![exists_and_not_null content(description)] } {
+    if { ![info exists content(description)] || $content(description) eq "" } {
         set content(description) " "
     }
     
@@ -79,7 +79,7 @@
         set pubDate [clock format [clock seconds] -format $fmt]
     }
     
-    if { [exists_and_not_null content(categories)] } {
+    if { [info exists content(categories)] && $content(categories) ne "" } {
 	# Only looking at the first category
 	set category_id [lars_blogger::category::get_id_by_name \
 			     -package_id $package_id \
@@ -131,11 +131,11 @@
         -object_id $entry_id \
         -privilege write
 
-    if { ![exists_and_not_null content(title)] } {
+    if { ![info exists content(title)] || $content(title) eq "" } {
         set content(title) " "
     }
     
-    if { ![exists_and_not_null content(description)] } {
+    if { ![info exists content(description)] || $content(description) eq "" } {
         set content(description) " "
     }
     
@@ -147,7 +147,7 @@
         set pubDate [clock format [clock seconds] -format $fmt]
     }
     
-    if { [exists_and_not_null content(categories)] } {
+    if { [info exists content(categories)] && $content(categories) ne "" } {
 	# Only looking at the first category
 	set category_id [lars_blogger::category::get_id_by_name \
 			     -package_id $package_id \
Index: openacs-4/packages/lars-blogger/tcl/rss-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/rss-procs.tcl,v
diff -u -r1.13 -r1.14
--- openacs-4/packages/lars-blogger/tcl/rss-procs.tcl	11 Sep 2013 07:23:43 -0000	1.13
+++ openacs-4/packages/lars-blogger/tcl/rss-procs.tcl	30 Oct 2013 17:37:08 -0000	1.14
@@ -12,7 +12,7 @@
 ad_proc -public lars_blogger::rss::get_subscr_id_list {
     {-package_id ""}
 } {
-    if { [empty_string_p $package_id] } {
+    if { $package_id eq "" } {
         set package_id [ad_conn package_id]
     }
 
@@ -62,7 +62,7 @@
     set column_array(channel_link) $blog_url
 
     set image_url [parameter::get -package_id $package_id -parameter "channel_image_url"]
-    if { [empty_string_p $image_url] } {
+    if { $image_url eq "" } {
         set column_array(image) ""
     } else {
         set column_array(image) [list \
@@ -77,14 +77,14 @@
     set counter 0
 
 
-    if { [empty_string_p $user_id] } {
+    if { $user_id eq "" } {
         set statement "blog_rss_items" 
     } else {
         set statement "user_blog_rss_items"
     }
 
     set rss_max_description_length [parameter::get -parameter rss_max_description_length -package_id $package_id -default 0]
-    if { [empty_string_p $rss_max_description_length] } {
+    if { $rss_max_description_length eq "" } {
         set rss_max_description_length 0
     }
 
@@ -96,7 +96,7 @@
         regsub -all {<[^>]*>} $content {} content_as_text
 
         if { $rss_max_description_length > 0 && [string length $content_as_text] > $rss_max_description_length } {
-            set description "[string range $content_as_text 0 [expr {$rss_max_description_length-3}]]..."
+            set description "[string range $content_as_text 0 $rss_max_description_length-3]..."
         } else {
             set description $content_as_text
         }
@@ -142,7 +142,7 @@
 
     db_1row select_package_id_user_id {}
 
-    if { [empty_string_p $user_id] } {
+    if { $user_id eq "" } {
         db_0or1row get_last_update {}
     } else {
         db_0or1row get_last_user_update {}
Index: openacs-4/packages/lars-blogger/tcl/technorati-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/technorati-procs.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/lars-blogger/tcl/technorati-procs.tcl	15 Jun 2012 19:12:21 -0000	1.2
+++ openacs-4/packages/lars-blogger/tcl/technorati-procs.tcl	30 Oct 2013 17:37:09 -0000	1.3
@@ -162,18 +162,18 @@
     set type "weblog"
     set version "0.9"
     
-    if { [string equal $key ""] } {
+    if {$key eq ""} {
         error "No Technorati API key available"
     }
     
-    if { [string equal $url ""] } {
+    if {$url eq ""} {
         set url "[ad_url][lars_blog_public_package_url]"
     }
     
     set api_url "http://api.technorati.com/cosmos?[export_vars -url [list key url type version]]"
     
     array set f [ad_httpget -url $api_url -timeout 60]
-    if { [string equal $f(status) "200"] } {
+    if {$f(status) == 200} {
         return $f(page)
     } else {
         error "ad_httpget error"
Index: openacs-4/packages/lars-blogger/tcl/test/blogger-api-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/test/blogger-api-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/lars-blogger/tcl/test/blogger-api-procs.tcl	23 Feb 2005 15:28:57 -0000	1.3
+++ openacs-4/packages/lars-blogger/tcl/test/blogger-api-procs.tcl	30 Oct 2013 17:37:09 -0000	1.4
@@ -34,7 +34,7 @@
                         -last_name $ln \
                         -password $password]
     
-    if { [string equal $user(creation_status) ok] } {
+    if {$user(creation_status) eq "ok"} {
         set user_id $user(user_id)
         permission::grant -party_id $user_id \
             -object_id $blog_id \
Index: openacs-4/packages/lars-blogger/www/blog-months.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog-months.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/lars-blogger/www/blog-months.tcl	16 Oct 2006 15:21:54 -0000	1.7
+++ openacs-4/packages/lars-blogger/www/blog-months.tcl	30 Oct 2013 17:37:09 -0000	1.8
@@ -3,7 +3,7 @@
 }
 set package_url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
 
-if [empty_string_p $screen_name] {
+if {$screen_name eq ""} {
     db_multirow -extend { url } months all_blog_months { *SQL* } {
 	set url "${package_url}archive/$month_url_stub"
     }
Index: openacs-4/packages/lars-blogger/www/blog.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog.tcl,v
diff -u -r1.27 -r1.28
--- openacs-4/packages/lars-blogger/www/blog.tcl	9 Nov 2008 23:29:27 -0000	1.27
+++ openacs-4/packages/lars-blogger/www/blog.tcl	30 Oct 2013 17:37:09 -0000	1.28
@@ -30,11 +30,11 @@
     set create_p [permission::permission_p -object_id $package_id -privilege create]
 }
 
-if {![exists_and_not_null unpublish_p]} { 
+if {(![info exists unpublish_p] || $unpublish_p eq "")} { 
     set unpublish_p 1
 }
-if {![exists_and_not_null manageown_p]} { 
-    set manageown_p [expr ![permission::permission_p -object_id $package_id -privilege admin]]
+if {(![info exists manageown_p] || $manageown_p eq "")} { 
+    set manageown_p [expr {![permission::permission_p -object_id $package_id -privilege admin]}] 
 }
 
 
@@ -59,28 +59,28 @@
     set blog_user_id [cc_screen_name_user $screen_name]
 }
 
-if { ![exists_and_not_null max_num_entries] } {
+if { ![info exists max_num_entries] || $max_num_entries eq "" } {
     set max_num_entries [parameter::get \
                              -package_id $package_id \
                              -parameter MaxNumEntriesOnFrontPage \
                              -default {}]
 }
 
-if { ![exists_and_not_null min_num_entries] } {
+if { ![info exists min_num_entries] || $min_num_entries eq "" } {
     set min_num_entries [parameter::get \
                              -package_id $package_id \
                              -parameter MinNumEntriesOnFrontPage \
                              -default {}]
 }
 
-if { ![exists_and_not_null num_days] } {
+if { ![info exists num_days] || $num_days eq "" } {
     set num_days [parameter::get \
                       -package_id $package_id \
                       -parameter NumDaysOnFrontPage \
                       -default {}]
 }
 
-if { ![exists_and_not_null max_content_length] } {
+if { ![info exists max_content_length] || $max_content_length eq "" } {
     set max_content_length [parameter::get \
                                 -package_id $package_id \
                                 -parameter max_content_length \
@@ -105,12 +105,12 @@
         set date_clause {}
         set limit {}
 
-        if { ![empty_string_p $max_num_entries] && $max_num_entries != 0 } {
+        if { $max_num_entries ne "" && $max_num_entries != 0 } {
             # MaxNumEntriesOnFrontPage parameter is set, which means we should limit to that
             set limit $max_num_entries
         } 
 
-        if { ![empty_string_p $num_days] && $num_days != 0 } {
+        if { $num_days ne "" && $num_days != 0 } {
             # NumDaysOnFrontPage parameter is set, which means we should limit to that
             set date_clause [db_map date_clause_default]
         }
@@ -124,7 +124,7 @@
     }
 }
 
-set show_poster_p [ad_parameter "ShowPosterP" "" "1"]
+set show_poster_p [parameter::get -parameter "ShowPosterP" -default "1"]
 
 set package_url [lars_blog_public_package_url -package_id $package_id]
 
@@ -137,11 +137,11 @@
 }
 
 # Check that the date limit is not limiting us to show less than min_num_entries entries
-if { ![string equal $type "archive"] && 
-     ![empty_string_p $min_num_entries] && $min_num_entries != 0 && 
-     ![empty_string_p $num_days] && $num_days != 0 
+if { $type ne "archive" && 
+     $min_num_entries ne "" && $min_num_entries != 0 && 
+     $num_days ne "" && $num_days != 0 
  } {
-    if { [empty_string_p $blog_user_id] } {
+    if { $blog_user_id eq "" } {
         set num_entries [db_string num_entries_by_date_all {}]
     } else {
         set num_entries [db_string num_entries_by_date {}]
@@ -161,7 +161,7 @@
     set arr_category_short_name($category_id) $short_name
 }
 
-if { [empty_string_p $blog_user_id] } {
+if { $blog_user_id eq "" } {
     set user_filter_where_clause ""
     set archive_url "${package_url}archive/"
 } else {
@@ -198,7 +198,7 @@
     # Putting the limit in the query won't give correct results.  We
     # need to do it here:
 
-    if {$limit != ""} {
+    if {$limit ne ""} {
       if {$output_rows_count >= $limit} {break}
     }
 
@@ -209,9 +209,9 @@
       $category_id != $blog_category_id} {continue}
 
     set sw_category_url ""
-    if { $sw_category_id != "" } {
+    if { $sw_category_id ne "" } {
         set sw_category_url "${package_url}"
-        if { [exists_and_not_null screen_name] } {
+        if { ([info exists screen_name] && $screen_name ne "") } {
     	  append sw_category_url "user/$screen_name"
         }
         append sw_category_url "swcat/$sw_category_id"
@@ -256,6 +256,6 @@
 
 template::head::add_css -href $stylesheet_url
 
-if { [exists_and_not_null display_template] } {
+if { ([info exists display_template] && $display_template ne "") } {
     ad_return_template $display_template
 }
Index: openacs-4/packages/lars-blogger/www/calendar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/calendar.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/lars-blogger/www/calendar.tcl	8 Aug 2006 21:26:57 -0000	1.7
+++ openacs-4/packages/lars-blogger/www/calendar.tcl	30 Oct 2013 17:37:09 -0000	1.8
@@ -21,7 +21,7 @@
 set package_url [lars_blog_public_package_url -package_id $package_id]
 set month_number [clock format [clock scan $date] -format %m]
 
-if {[empty_string_p $screen_name]} {
+if {$screen_name eq ""} {
     db_foreach all_entry_dates { * SQL * } {
 	ns_set put $calendar_details $entry_date_julian "1"
     }
@@ -31,7 +31,7 @@
     }
 }
 
-if {[empty_string_p $screen_name]} {
+if {$screen_name eq ""} {
 
     set day_number_template "\[ad_decode \[ns_set get \$calendar_details \$julian_date\] 1 \"<a href=\\\"${package_url}archive/\$year/$month_number/\[format \"%02d\" \$day_number\]/\\\" title=\\\"View the entries for this date\\\"><b>\$day_number</b></a>\" \$day_number\]"
 
Index: openacs-4/packages/lars-blogger/www/category-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/category-edit.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/lars-blogger/www/category-edit.tcl	16 Oct 2006 15:21:54 -0000	1.8
+++ openacs-4/packages/lars-blogger/www/category-edit.tcl	30 Oct 2013 17:37:09 -0000	1.9
@@ -26,7 +26,7 @@
     ad_script_abort
 }
 
-if { [empty_string_p $return_url] } {
+if { $return_url eq "" } {
     set return_url [ad_conn url]
 }
 
@@ -56,7 +56,7 @@
 
 } -on_submit {
     
-    if { ![empty_string_p $short_name] } {
+    if { $short_name ne "" } {
 	db_1row short_name_exists { *SQL* }
 	if { $short_name_exists > 0 } {
 	    form set_error category short_name "[_ lars-blogger.lt_This_short_name_is_al]"
Index: openacs-4/packages/lars-blogger/www/entry-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/entry-chunk.tcl,v
diff -u -r1.23 -r1.24
--- openacs-4/packages/lars-blogger/www/entry-chunk.tcl	11 Mar 2007 17:20:49 -0000	1.23
+++ openacs-4/packages/lars-blogger/www/entry-chunk.tcl	30 Oct 2013 17:37:09 -0000	1.24
@@ -17,10 +17,10 @@
 # the template we are included from.
 template::multirow -local -ulevel 1 upvar $mrname sw_category_multirow
 
-if { ![exists_and_not_null perma_p] } {
+if { ![info exists perma_p] || $perma_p eq "" } {
     set perma_p 0
 }
-if { ![exists_and_not_null show_comments_p] } {
+if { (![info exists show_comments_p] || $show_comments_p eq "") } {
     set show_comments_p $perma_p
 }
 
@@ -30,14 +30,14 @@
     set package_id [ad_conn package_id]
 }
 
-if { ![exists_and_not_null return_url] } {
+if { ![info exists return_url] || $return_url eq "" } {
     set return_url [ad_return_url]
 }
-if { ![exists_and_not_null screen_name] } {
+if { ![info exists screen_name] || $screen_name eq "" } {
     set screen_name ""
 }
 
-if { ![exists_and_not_null max_content_length] } {
+if { ![info exists max_content_length] || $max_content_length eq "" } {
     set max_content_length 0
 }        
 
@@ -47,7 +47,7 @@
 
 set general_comments_package_url [general_comments_package_url]
 
-set show_poster_p [ad_parameter "ShowPosterP" "" "1"]
+set show_poster_p [parameter::get -parameter "ShowPosterP" -default "1"]
 
 set entry_id $blog(entry_id)
 set admin_p [permission::permission_p -object_id $entry_id -party_id $user_id -privilege admin]
Index: openacs-4/packages/lars-blogger/www/entry-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/entry-edit.tcl,v
diff -u -r1.29 -r1.30
--- openacs-4/packages/lars-blogger/www/entry-edit.tcl	11 Sep 2013 07:23:43 -0000	1.29
+++ openacs-4/packages/lars-blogger/www/entry-edit.tcl	30 Oct 2013 17:37:09 -0000	1.30
@@ -32,7 +32,7 @@
 # If we're in DisplayUserP mode, the user must have a screen name setup
 if { [parameter::get -parameter "DisplayUsersP" -default 0] } {
     acs_user::get -user_id [ad_conn user_id] -array user_info
-    if { [empty_string_p $user_info(screen_name)] } {
+    if { $user_info(screen_name) eq "" } {
 
         set page_title "[_ lars-blogger.Screen_Name]"
         set context [list $page_title]
@@ -64,7 +64,7 @@
 
 # If categories are enabled, set up a select-box with option. 
 
-if { [string equal [lars_blog_categories_p] "1"] } {
+if {[lars_blog_categories_p] eq "1"} {
     set options_list [db_list_of_lists categories {}]
     if { [llength $options_list] > 0 } {
         set option_list [concat [list [list None ""]] $options_list]
@@ -104,7 +104,7 @@
         }
     }
 }
-set unpublish_p [expr ![parameter::get -parameter ImmediatePublishP -default 0]]
+set unpublish_p [expr {![parameter::get -parameter ImmediatePublishP -default 0]}] 
 
 if {$unpublish_p} {
     ad_form -extend -name entry -form {
@@ -209,7 +209,7 @@
     -validate {{
         title_url
         {[
-            expr {[empty_string_p $title_url] || \
+            expr {$title_url eq "" || \
                 [util_url_valid_p $title_url]
             }
         ]}
Index: openacs-4/packages/lars-blogger/www/entry-headline.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/entry-headline.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/lars-blogger/www/entry-headline.tcl	9 Nov 2008 23:29:27 -0000	1.3
+++ openacs-4/packages/lars-blogger/www/entry-headline.tcl	30 Oct 2013 17:37:09 -0000	1.4
@@ -17,10 +17,10 @@
 # the template we are included from.
 template::multirow -local -ulevel 1 upvar $mrname sw_category_multirow
 
-if { ![exists_and_not_null perma_p] } {
+if { ![info exists perma_p] || $perma_p eq "" } {
     set perma_p 0
 }
-if { ![exists_and_not_null show_comments_p] } {
+if { ![info exists show_comments_p] || $show_comments_p eq "" } {
     set show_comments_p $perma_p
 }
 
@@ -30,14 +30,14 @@
     set package_id [ad_conn package_id]
 }
 
-if { ![exists_and_not_null return_url] } {
+if { ![info exists return_url] || $return_url eq "" } {
     set return_url [ad_return_url]
 }
-if { ![exists_and_not_null screen_name] } {
+if { ![info exists screen_name] } {
     set screen_name ""
 }
 
-if { ![exists_and_not_null max_content_length] } {
+if { ![info exists max_content_length] || $max_content_length eq "" } {
     set max_content_length 0
 }        
 
@@ -47,11 +47,11 @@
 
 set general_comments_package_url [general_comments_package_url]
 
-set show_poster_p [ad_parameter "ShowPosterP" "" "1"]
+set show_poster_p [parameter::get -parameter "ShowPosterP" -default "1"]
 
 set entry_id $blog(entry_id)
 
-if { [empty_string_p $screen_name] } {
+if { $screen_name eq "" } {
     set blog(permalink_url) "${package_url}one-entry?[export_vars { entry_id }]"
 } else {
     set blog(permalink_url) "${package_url}user/$screen_name/one-entry?[export_vars { entry_id }]"
Index: openacs-4/packages/lars-blogger/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/index.tcl,v
diff -u -r1.32 -r1.33
--- openacs-4/packages/lars-blogger/www/index.tcl	28 Dec 2007 02:20:47 -0000	1.32
+++ openacs-4/packages/lars-blogger/www/index.tcl	30 Oct 2013 17:37:09 -0000	1.33
@@ -25,15 +25,15 @@
 set context [list]
 set context_base_url $package_url
 
-if { ![empty_string_p $screen_name] } {
+if { $screen_name ne "" } {
     # Show Screen Name in context bar
     append context_base_url /user/$screen_name
     lappend context [list $context_base_url $screen_name]
 
     append package_url_with_extras user/$screen_name/
 }
 
-if { ![empty_string_p $category_short_name] } {
+if { $category_short_name ne "" } {
     if { ![db_0or1row get_category_from_short_name {}] } {
 	ad_return_error "[_ lars-blogger.lt_Category_doesnt_exist]" "[_ lars-blogger.lt_The_specified_categor]"
 	return
@@ -51,7 +51,7 @@
 # 3 items - RSS, RSD and stylesheet.
 set rss_file_url [parameter::get -parameter rss_file_url -default ""]
 if { $rss_file_url eq "" && ![empty_string_p [parameter::get -parameter "rss_file_name"]] } {
-    if {[exists_and_not_null screen_name]} {
+    if {([info exists screen_name] && $screen_name ne "")} {
         set rss_file_url "${package_url}user/$screen_name/rss/[parameter::get -parameter "rss_file_name"]"
     } else {
         set rss_file_url "${package_url}rss/[parameter::get -parameter "rss_file_name"]"
@@ -66,12 +66,12 @@
 
 set stylesheet_url [lars_blog_stylesheet_url]
 
-set unpublish_p [expr ![parameter::get -parameter ImmediatePublishP -default 0]]
+set unpublish_p [expr {![parameter::get -parameter ImmediatePublishP -default 0]}] 
 
 # We say manageown if manageown set and not admin on the package.
 set manageown_p [parameter::get -parameter OnlyManageOwnPostsP -default 0]
 if {$manageown_p} {
-    set manageown_p [expr ![permission::permission_p -object_id $package_id -privilege admin]]
+    set manageown_p [expr {![permission::permission_p -object_id $package_id -privilege admin]}] 
 }
 
 # header stuffs
@@ -90,7 +90,7 @@
 set display_users_p [parameter::get -parameter "DisplayUsersP" -default 0]
 set display_categories [lars_blog_categories_p -package_id $package_id]
 
-if {$display_users_p && ![exists_and_not_null screen_name]} {
+if {$display_users_p && (![info exists screen_name] || $screen_name eq "")} {
 
     set display_bloggers_p 1
 
@@ -121,7 +121,7 @@
 
 set header_background_color [lars_blog_header_background_color]
 
-if { [exists_and_not_null year] } {
+if { ([info exists year] && $year ne "") } {
     
     set index_page_p 0
 
@@ -132,8 +132,8 @@
     append context_base_url $year
     lappend context [list $context_base_url $year]
 
-    if { [exists_and_not_null day] } {
-        if {[db_type] == "oracle"} {
+    if { ([info exists day] && $day ne "") } {
+        if {[db_type] eq "oracle"} {
           # Oracle does have format called 'day' but it means
           # something else...
           set interval "ddd"
@@ -148,7 +148,7 @@
 	append context_base_url /$day
 	lappend context [list $context_base_url $day]
 
-    } elseif { [exists_and_not_null month] } {
+    } elseif { ([info exists month] && $month ne "") } {
         set interval "month"
         db_1row archive_date_month {}
 
@@ -175,9 +175,9 @@
 
 # Site-Wide Categories
 
-if { ![empty_string_p $sw_category_id] } {
+if { $sw_category_id ne "" } {
     set sw_category_name [category::get_name $sw_category_id]
-    if { [empty_string_p $sw_category_name] } {
+    if { $sw_category_name eq "" } {
         ad_return_exception_page 404 "No such category" "Site-wide \
           Category with ID $sw_category_id doesn't exist"
 	    return
@@ -214,7 +214,7 @@
 
 # Cut the URL off the last item in the context bar
 if { [llength $context] > 0 } {
-    set context [lreplace $context end end [lindex [lindex $context end] end]]
+    set context [lreplace $context end end [lindex $context end end]]
 }
 
 set blog_name [lars_blog_name]
Index: openacs-4/packages/lars-blogger/www/one-entry.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/one-entry.tcl,v
diff -u -r1.19 -r1.20
--- openacs-4/packages/lars-blogger/www/one-entry.tcl	17 Dec 2007 18:33:14 -0000	1.19
+++ openacs-4/packages/lars-blogger/www/one-entry.tcl	30 Oct 2013 17:37:09 -0000	1.20
@@ -5,10 +5,10 @@
 
 set package_id [ad_conn package_id]
 
-set show_poster_p [ad_parameter "ShowPosterP" "" "1"]
+set show_poster_p [parameter::get -parameter "ShowPosterP" -default "1"]
 
 if {[catch {lars_blogger::entry::get -entry_id $entry_id -array blog} errMsg]} {
-    if {[string equal $::errorCode NOT_FOUND]} {
+    if {$::errorCode eq "NOT_FOUND"} {
         ns_returnnotfound
         ad_script_abort
     }
@@ -19,12 +19,12 @@
 
 set sw_category_multirow "__branimir__multirow__blog/$entry_id"
 
-set unpublish_p [expr ![parameter::get -parameter ImmediatePublishP -default 0]]
+set unpublish_p [expr {![parameter::get -parameter ImmediatePublishP -default 0]}] 
 
 # We say manageown if manageown set and not admin on the package.
 set manageown_p [parameter::get -parameter OnlyManageOwnPostsP -default 0]
 if {$manageown_p} {
-    set manageown_p [expr ![permission::permission_p -object_id $package_id -privilege admin]]
+    set manageown_p [expr {![permission::permission_p -object_id $package_id -privilege admin]}] 
 }
 
 template::multirow create $sw_category_multirow sw_category_id \
@@ -34,9 +34,9 @@
 
 foreach sw_category_id [category::get_mapped_categories $entry_id] {
   set sw_category_url ""
-  if { $sw_category_id != "" } {
+  if { $sw_category_id ne "" } {
       set sw_category_url "${package_url}"
-      if { [exists_and_not_null screen_name] } {
+      if { ([info exists screen_name] && $screen_name ne "") } {
   	  append sw_category_url "user/$screen_name"
       }
       append sw_category_url "swcat/$sw_category_id"
@@ -57,7 +57,7 @@
 
 set page_title $blog(title)
 
-if {![exists_and_not_null screen_name]} {
+if {![info exists screen_name] || $screen_name eq ""} {
     set screen_name ""
     set context [list $page_title]
     set blog(permalink_url) "${package_url}one-entry?[export_vars { entry_id }]"
Index: openacs-4/packages/lars-blogger/www/admin/blogroll-move.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/admin/blogroll-move.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/lars-blogger/www/admin/blogroll-move.tcl	14 Dec 2003 13:02:37 -0000	1.1
+++ openacs-4/packages/lars-blogger/www/admin/blogroll-move.tcl	30 Oct 2013 17:37:09 -0000	1.2
@@ -11,8 +11,8 @@
 set package_id [ad_conn package_id]
 
 # Check that direction is up or down, and that package_id is correct
-if { (![string equal $direction "up"] && ![string equal $direction "down"])
-  || ![string equal [db_string entry_package_id "" -default 0] $package_id] } {
+if { ($direction ne "up" && $direction ne "down" )
+  || [db_string entry_package_id "" -default 0] ne $package_id } {
     ad_returnredirect "blogroll"
     ad_script_abort
 }
@@ -23,28 +23,28 @@
     set current_order [db_list current_order ""]
     
     # Go away if the current link_id is not in there
-    if { [lsearch -exact $current_order $link_id] == -1 } {
+    if {$link_id ni $current_order} {
         db_abort_transaction
         ad_returnredirect "blogroll"
         ad_script_abort
     }
     
     # Current position
     set current_position [lsearch -exact $current_order $link_id]
-    set last_position [expr [llength $current_order]-1]
+    set last_position [expr {[llength $current_order]-1}]
     
     # Calculate new position
-    if { $direction == "up" && $current_position != 0 } {
-        set new_position [expr $current_position-1]
-    } elseif { $direction == "down" && $current_position != $last_position } {
-        set new_position [expr $current_position+1]
+    if { $direction eq "up" && $current_position != 0 } {
+        set new_position [expr {$current_position-1}]
+    } elseif { $direction eq "down" && $current_position != $last_position } {
+        set new_position [expr {$current_position+1}]
     }
     
     if { [info exists new_position] } {
         # Put displaced entry in current position
         set displaced_entry [lindex $current_order $new_position]
         
-        if { $direction == "down"} {
+        if { $direction eq "down"} {
             set new_order [lreplace $current_order $current_position $new_position $displaced_entry $link_id]
         } else {
             set new_order [lreplace $current_order $new_position $current_position $link_id $displaced_entry] 
Index: openacs-4/packages/lars-blogger/www/admin/ping-urls.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/admin/ping-urls.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/lars-blogger/www/admin/ping-urls.tcl	8 Aug 2006 21:26:58 -0000	1.3
+++ openacs-4/packages/lars-blogger/www/admin/ping-urls.tcl	30 Oct 2013 17:37:09 -0000	1.4
@@ -41,7 +41,7 @@
     "blo.gs" "http://ping.blo.gs/"
     "Technorati.com" "http://rpc.technorati.com/rpc/ping"
 } {
-    if { [lsearch -exact $ping_urls $ping_url] == -1 } {
+    if {$ping_url ni $ping_urls} {
         multirow append default_pings $service $ping_url
     }
 }