Rating in widget

HI,
i change the codes a little to display excerpt and rating (directory plugin) in each post. However, as you can see in the attach image the rating system works well only at the first post but in the others posts the rating system don't get the css for the stars.