Currently the url of your site is grabbed internally from drupal and results in urls like:
http://example.com/node/1

instead of:
http://example.com/interesting-post

Find this code in addthis.module (line 29):

					<script type="text/javascript">a2a_linkname="'.$node->title.'";a2a_linkurl="'.$link_url.'";</script>

and replace with:

					<script type="text/javascript">a2a_linkname="'.$node->title.'";a2a_linkurl=location.href;</script>

You may optionally remove the if statement switching between clean urls.

Comments

tseven’s picture

Title: Fix for using the -actual- url » Fix for using the -actual- url take 2

My above solution doesn't take into account if javascript is disabled.

The following works with or without javascript:

Find

	if(variable_get('clean_url','0')==0)
		$link_url = $base_url.'/?q='.$_GET['q'];
	else
		$link_url = $base_url.'/'.$_GET['q'];

and replace with:

		$link_url = $base_url . $_SERVER['REQUEST_URI'];
vesapalmu’s picture

Version: 6.x-2.3 » 5.x-1.x-dev
Assigned: tseven » vesapalmu
Status: Active » Closed (won't fix)

Hmm.. what version of the module are you working with? Link url is currently created this way:

$teaser ? url('node/'. $node->nid, array('absolute' => 1) ) : '[URL]'

In normal cases Javascript takes care of creating the URL, but in teasers absolute URL is created using internal url function in Drupal.

1.x versions of addthis module are deprecated.

tseven’s picture

Oops! My bad, this fix was meant for Add to Any,...

Please forgive this embarrassing oversight.