Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- i am using Thumbs up / down widget from rate module.
- in Thumbs up / down widget count i have converted from
- percentage to point by making following changes:
- 1)copy rate-template-thumbs-up-down.tpl from
- sites/all/modules/contrib/rate/templates/thumbs-up-down
- 2) and past in sites/all/themes/custom/name_of_theme/templates
- 3) override with following code:
- <?php
- /**
- * @file
- * Rate widget theme
- */
- $path = current_path();
- ?>
- <?php if ($path == 'donate') : ?>
- <?php print $results['up_percent'] . '%'; ?>
- <?php else : ?>
- <div class="like-container">
- <div class="like-count-text">
- <div class="thumbs-up">
- <?php print $up_button; ?>
- </div>
- <div class="count-text">
- <div class="like-count"><?php print $results['up']; ?></div>
- <div class="total-likes-text"> total likes</div>
- </div>
- </div>
- <div class="likes-button">
- <?php
- print theme('rate_button', array(
- 'text' => t('Likes'),
- 'href' => $links[0]['href'],
- 'class' => "likes-button-link")
- );
- ?>
- </div>
- </div>
- <div class="dislike-container">
- <div class="dislike-count-text">
- <div class="thumbs-down">
- <?php print $down_button; ?>
- </div>
- <div class="count-text">
- <div class="dislike-count"><?php print $results['down']; ?></div>
- <div class="total-likes-text"> total dislikes</div>
- </div>
- </div>
- <div class="dislikes-button">
- <?php
- print theme('rate_button', array(
- 'text' => t('Dislikes'),
- 'href' => $links[1]['href'],
- 'class' => "dislikes-button-link")
- );
- ?>
- </div>
- </div>
- <?php endif; ?>
- 4) now i am getting Thumbs up / down widget count in point not in
- percentage
- 5) next that i have integrate this with view.
- 6) after theme it looks like this:
- ![enter image description here][1]
- 7) Purpose : here i would like to sort only on the basis of thumbs up
- or likes.
- 8) restriction : can only use one Thumbs up / down widget.
- 9) in views how can i sort only on the basis of Thumbs up or like.
- Thanks
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement