}
?>
            <!-- End blog-meta-icon -->
            <div class="blog-meta-date">
                <h4 class="blogDate"><?php 
print date('d', $node->created);
?>
</h4>
                <h5 class="blogMonth text-center"><?php 
print date('F', $node->created);
?>
</h5>
            </div>
            <!-- End blog-meta-date -->
<?php 
$total_vote = fivestar_get_votes('node', $node->nid);
?>
                <?php 
if ($total_vote) {
    ?>
                <div class="blog-meta-vote text-center">
                    <span class="fa fa-heart-o"></span>
                    <?php 
    if (count($total_vote['count']) > 0) {
        ?>
                        <h6> <?php 
        print $total_vote['count']['value'] . '&nbsp;' . t('(votes)');
        ?>
</h6>
                    <?php 
    } else {
Пример #2
0
function phptemplate_comment_view($comment, $node, $links = array(), $visible = TRUE)
{
    $rating_threshold = 10;
    $count_threshold = 0;
    $votes = fivestar_get_votes('comment', $comment->cid);
    if ($votes['average']['value'] < $rating_threshold && $votes['count']['value'] >= $count_threshold && arg(2) != $comment->cid) {
        $visible = FALSE;
        $comment->subject = t("(view hidden comment)") . " " . $comment->subject;
    }
    return theme_comment_view($comment, $node, $links, $visible);
}
?>
	      </div>
	    </div>
      </div>
    <div id="gen-else">
	  <div class="main">
        <?php 
if (arg(0) != 'print') {
    ?>
	        <div itemscope itemtype="http://schema.org/Product">
		    <div id="gen-title"><h1 itemprop="name"><?php 
    print $title;
    ?>
</h1></div>
		    <?php 
    $design = fivestar_get_votes('node', $node->nid, 'vote', NULL);
    $rating = $design['average']['value'];
    $total = $design['count']['value'];
    //dsm($design);
    ?>
		    <div itemprop="description"></div>
		  <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
		    <div>
		      <meta itemprop="ratingValue" content="<?php 
    print $rating / 20;
    ?>
">		      
		      <meta itemprop="bestRating" content="5"/>
		      <meta itemprop="worstRating" content="1"/>
		      <meta itemprop="ratingCount" content="<?php 
    print $total;
Пример #4
0
}
?>
    <div id="ratings">
      <?php 
//Simplest way to implement fivestar
//print fivestar_widget_form($node, 'lyrics');
//print fivestar_widget_form($node, 'music');
//print fivestar_widget_form($node, 'flow');
print "<h3>" . t('Ratings') . "</h3>";
$nid = arg(1);
$nid = $node->tnid ? $node->tnid : $node->nid;
//only rate translation source
$output = '';
$tags = array('lyrics' => t('lyrics'), 'music' => t('music'), 'flow' => t('flow'));
foreach ($tags as $tag => $title) {
    $votes = fivestar_get_votes('node', $nid, $tag);
    $values = array('user' => isset($votes['user']['value']) ? $votes['user']['value'] : NULL, 'average' => isset($votes['average']['value']) ? $votes['average']['value'] : NULL, 'count' => isset($votes['count']['value']) ? $votes['count']['value'] : NULL);
    $settings = array('stars' => 5, 'allow_clear' => TRUE, 'style' => 'average', 'text' => 'dual', 'content_type' => 'node', 'content_id' => $nid, 'tag' => $tag, 'autosubmit' => TRUE, 'title' => $title, 'feedback_enable' => TRUE, 'labels_enable' => TRUE, 'labels' => array(t('Cancel it'), t('Poor'), t('Okay'), t('Good'), t('Great'), t('Awesome')));
    $output .= drupal_get_form('fivestar_custom_widget', $values, $settings);
}
print $output;
?>
    
    </div>
    <div class="content">
      <?php 
print $content;
?>
    </div>
    <?php 
if ($links) {