Modification of Fivestar module to not index or be used in Adsense context

This describes two modifications I have done to my sites Fivestar module. The first thing is to avoid indexing of words describing the rate levels "Star labels", like "Poor", "OK", "Good" and so on. While you are there you can always add relation attribute to avoid unnecessary follow of the rate link.

The second thing to do is to add comment tag to avoid AdSense analysing "Star labels" as content.

In fivesar.js on row 320, 6.x - 1.19

Existing:
$div = $('<div class="star star-' + count + ' star-' + zebra + first + last + '"><a href="#' + option.value + '" title="' + option.text + '">' + option.text + '</a></div>');

Add rel="noindex, nofollow" to a-tag:
$div = $('<div class="star star-' + count + ' star-' + zebra + first + last + '"><a rel="noindex, nofollow" href="#' + option.value + '" title="' + option.text + '">' + option.text + '</a></div>');          

In fivesar.module, on row 933, 945, in the function fivestar_nodeapi(), 6.x - 1.19

Existing:
<?php
$node
->content['fivestar_widget'] = array(
               
'#value' => fivestar_widget_form($node),
               
'#weight' => $position == 'above' ? -10 : 50,
              );
?>

Add tags to array:
<?php
$node
->content['fivestar_widget'] = array(
               
'#value' => fivestar_widget_form($node),
               
'#weight' => $position == 'above' ? -10 : 50,
               
'#prefix' => "<!-- google_ad_section_start(weight=ignore) -->",
               
'#suffix' => "<!-- google_ad_section_end -->",
              );
?>
 
Note that you have to do this on two rows to handle both options.
Knowledge keywords: