Index: openacs-4/packages/ecommerce/tcl/social-networking-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/social-networking-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/tcl/social-networking-procs.tcl 12 Sep 2010 21:18:59 -0000 1.1 +++ openacs-4/packages/ecommerce/tcl/social-networking-procs.tcl 11 Nov 2011 19:40:42 -0000 1.2 @@ -12,18 +12,41 @@ returns html fragment, a series of links for sharing a webpage with others using social networking } { if { $url eq "" } { - set url [ad_return_url] + set url [ad_return_url -qualified] + # x and y paramters are generated in forms where submit button is type "image" + # remove gremilin x and y parameters from form posts by GET + # ie make urls less ugly when sharing. + if { [ad_conn method] != "POST" } { + regsub {[\&][x][\=][0-9]+} $url {} url + regsub {[\&][y][\=][0-9]+} $url {} url + } } if { $title eq "" } { set title [ad_conn instance_name] - ns_log Notice "ecds_share_bar: title has no value, substituting with instance_name" + ns_log Notice "ecds_share_bar: title apparently for $url has no value, substituting with instance_name" } - set links_html "
Share: -\"Tweet\"Tweet -\"Facebook\"Facebook -\"StumbleUpon\"StumbleUpon -\"Digg\"Digg -\"Delicious\"Delicious -
" + + set url [ns_urlencode $url] + set title [ns_urlencode $title] + + if { [security::secure_conn_p] } { + set links_html "Share: +Tweet +Facebook +StumbleUpon +Digg +Delicious +" + + } else { + set links_html "Share: +\"Tweet\"Tweet +\"Facebook\"Facebook +\"StumbleUpon\"StumbleUpon +\"Digg\"Digg +\"Delicious\"Delicious +" + + } return $links_html }