Views integration of Drupalit votes. These files will let you use the drupalit node votes as fields, as sorting criteria or filters for Views 2.x.

Copy the drupalit.views.inc file into your drupalit module folder and replace the drupalit.module file with the one provided here.

CommentFileSizeAuthor
#1 drupalit.png16.64 KBDesi Raaj
drupalit.tar_.gz7.03 KBcgzamate

Comments

Desi Raaj’s picture

Priority: Normal » Critical
StatusFileSize
new16.64 KB

could you please include icon instead of just plain text...see attachment.
here is exactly what i'm trying to do:
-create a view that will display top voted stories
-in views, i'm using "Table" as "Style"
-the table includes two fields, one for displaying drupalit votes widget (which is what i'm asking for) and second one for node title.

...currently the field only shows the number of votes casted, but not the widget.

decibel.places’s picture

great, now drupalit is integrated with views, but...

The drupalit.module file in this hack changes the function so that one must log in to vote

remove this code lines 274-290 to restore anonymous voting:

  //if the user has no access
  elseif (!user_access('user_access')) {
    if ($teaser) {
      $output = '
	    <div id="vote-wrap-'. $nid .'" class="vote-wrap-login">
		  <div id="vote-count-'. $nid .'" class="vote-count">'. $data['votes'] .'</div>
		    <a href="user/login?destination='. $_GET['q'] .'/'. $nid .'" title=""><span id="vote-text-'. $nid .'" class="vote-text">'. t('Login') .'</span></a>
	      </div>';
    }
    else {
      $output = '
	    <div id="vote-wrap-'. $nid .'" class="vote-wrap-login">
		  <div id="vote-count-'. $nid .'" class="vote-count">'. $data['votes'] .'</div>
		    <a href="/user/login?destination='. $_GET['q'] .'" title=""><span id="vote-text-'. $nid .'" class="vote-text">'. t('Login') .'</span></a>
	      </div>';
    }
  }