[development] Facebook like button count problem with drupal?

Fehér János feher.janos at mindworks.hu
Thu Jan 20 19:16:47 UTC 2011


Hi Rajat,

You can use this in node.tpl.php and page-node.tpl.php files:

<?php echo url('node/'. $node->nid, array('absolute' => TRUE)); ?>

This prints out the url of the node in absolute form (beginning with http:)

Bests,
Aries

2011/1/20 Rajat Arora <arora271 at yahoo.com>

> Hi List,
>
> I am facing an issue with the implementation of Facebook like button on my
> website. Here is quick summary of Issue:
>
> The like button is inserted for different pages which are shown after
> making a filter search on website. The problem is that, the like button
> increase the count for whole website instead of that particular page where
> the "like" button is pressed. It is always counting the likes for the
> server “abc.com” instead of calculating for different pages where the like
> button is pressed.
>
> Here is the code snippet used for implementation:
>
>
>
> *Code: *
>
>
>
> <div class="facebook_button">
>
>  {php}
>
>  function fetch_url() {
>
>  $curURL="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI<http://%22.$_SERVER%5B>
> '];
>
> return $curURL;
>
> }
>
> {/php}
>
>
>
> <iframe src=*"http://www.facebook.com/plugins/like.php?href={php<http://www.facebook.com/plugins/like.php?href=%7Bphp>}
> echo urlencode(fetch_url());
> {/php}&layout=button_count&show_faces=true&width=110&action=like&colorscheme=light&height=20&locale=de_DE"
> * scrolling=*"no"* frameborder=*"0"* style="border:*none*; overflow:*
> hidden*; width:*110px*; height:*20px*;" allowTransparency=*"true"*></
> iframe>
>
>
>
> *I don't know if anyone faces this issue before, but i cannot find
> anything relevant in the older posts.  *
>
> *Best Regards,*
>
> Rajat Arora
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110120/7239a470/attachment.html 


More information about the development mailing list