Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

get Rating on single.php file

By: a guest on Jan 6th, 2011  |  syntax: None  |  size: 1.69 KB  |  hits: 231  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <div class="likemsg clear">
  2. <h3>Liked these offers? Then Tweet it, Like it & Recommend it!</h3>
  3.  
  4. <?php echo tweetbutton(); ?>
  5.  
  6. <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=90&amp;action=like&amp;colorscheme=light&amp;height=22" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:90px; height:22px;float:left;margin-top:10px;"></iframe>
  7.  <?php echo polldaddy_get_rating_html(); ?>
  8.  
  9. </div>
  10.  
  11. CSS styles:
  12.  
  13. .likemsg{margin:0 0px 10px 8px;padding-bottom:10px;/*border-top:2px solid #eee;*/border:1px solid #d0d0b9;-webkit-border-radius: 6px;-moz-border-radius: 6px;border-radius: 6px;overflow:hidden;}
  14. .likemsg h3{font-size:120%;text-shadow:none;padding:5px 0 5px 8px;}
  15. .btmbar{margin:10px 3px 20px 8px;border-top:2px solid #eee;}
  16. .ratingstyle{float:right;margin-right:183px;width:200px;margin-top: 10px;overflow:hidden;}
  17.  
  18.  
  19. // add raingstyle in it
  20.  
  21. function polldaddy_get_rating_code( $rating_id, $unique_id, $title, $permalink, $item_id = '' ) {
  22.  
  23.         $html = "\n".'<div class="pd-rating ratingstyle" id="pd_rating_holder_' . $rating_id . $item_id . '"></div>
  24. <script type="text/javascript" charset="utf-8">
  25.         PDRTJS_settings_' . (int)$rating_id . $item_id . ' = {
  26.                 "id" : "' . (int)$rating_id . '",
  27.                 "unique_id" : "' . urlencode( $unique_id ) . '",
  28.                 "title" : "' . urlencode( $title ) . '",' . "\n";
  29.  
  30.                 if ( $item_id != '' )
  31.                         $html .=  ( '           "item_id" : "' . $item_id . '",' . "\n" );
  32.  
  33.                 $html .= '              "permalink" : "' . urlencode( clean_url( $permalink ) ) . '"';
  34.                 $html .= "\n    }\n";
  35.                 $html .=  "</script>\n";
  36.  
  37.         return $html;
  38.  
  39.  
  40. }