Exemplo n.º 1
0
<?php

echo rehub_get_user_rate('admin');
Exemplo n.º 2
0
 function rate_edd()
 {
     if (rehub_option('rehub_framework_edd_rating') == '1') {
         echo rehub_get_user_rate('user');
     }
 }
Exemplo n.º 3
0
    function rehub_get_review()
    {
        ?>
    <?php 
        $schema = rehub_option('type_schema_review') == 'editor' ? ' itemtype="http://schema.org/Review" itemscope="" itemprop="review"' : '';
        ?>
    <?php 
        $overal_score = rehub_get_overall_score();
        $postAverage = get_post_meta(get_the_ID(), 'post_user_average', true);
        ?>
	<div class="rate_bar_wrap<?php 
        if (rehub_option('type_user_review') == 'full_review' && ($postAverage != '0' && $postAverage != '')) {
            echo ' two_rev';
        }
        if (rehub_option('color_type_review') == 'multicolor') {
            echo ' colored_rate_bar';
        }
        ?>
"<?php 
        echo $schema;
        ?>
>
		<?php 
        if (rehub_option('type_schema_review') == 'editor') {
            ?>
			<div style="display:none" itemprop="reviewBody"><?php 
            echo wp_kses_post(vp_metabox('rehub_post.review_post.0.review_post_summary_text'));
            ?>
</div>
	        <?php 
            if (get_the_author_meta('google')) {
                ?>
	            <div class="vcard author disauthor" itemprop="author" itemscope itemtype="http://schema.org/Person"><strong class="fn" itemprop="name"><a href="<?php 
                the_author_meta('google');
                ?>
?rel=author">+<?php 
                echo get_the_author();
                ?>
</a></strong></div>
	        <?php 
            } else {
                ?>
	            <div class="vcard author disauthor" itemprop="author" itemscope itemtype="http://schema.org/Person"><strong class="fn" itemprop="name"><?php 
                the_author_posts_link();
                ?>
</strong></div>
	        <?php 
            }
            ?>
        
        <?php 
        }
        ?>
 		
		<?php 
        if ($overal_score != '0') {
            ?>
			<div class="review-top">				
			<?php 
            if (rehub_option('type_schema_review') == 'user' && rehub_option('type_user_review') == 'full_review') {
                ?>
				<div class="overall-score" itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">
					<meta itemprop="worstRating" content="1" />
					<meta itemprop="bestRating" content="10" />
					<span class="overall r_score_<?php 
                echo round($overal_score);
                ?>
" itemprop="ratingValue"><?php 
                echo round($overal_score, 1);
                ?>
</span>
					<span class="overall-text"><?php 
                _e('Total Score', 'rehub_framework');
                ?>
</span>
					<div class="overall-user-votes"><span itemprop="ratingCount"><?php 
                $user_rates = get_post_meta(get_the_ID(), 'post_user_raitings', true);
                echo $user_rates['criteria'][0]['count'];
                ?>
</span> <?php 
                _e('reviews', 'rehub_framework');
                ?>
</div>				
				</div>				
			<?php 
            } elseif (rehub_option('type_schema_review') == 'editor') {
                ?>
				<div class="overall-score" itemtype="http://schema.org/Rating" itemscope="" itemprop="reviewRating">
					<meta itemprop="worstRating" content="1" />
					<meta itemprop="bestRating" content="10" />
					<span class="overall r_score_<?php 
                echo round($overal_score);
                ?>
" itemprop="ratingValue"><?php 
                echo round($overal_score, 1);
                ?>
</span>
					<span class="overall-text"><?php 
                _e('Total Score', 'rehub_framework');
                ?>
</span>
				</div>			
			<?php 
            } else {
                ?>
				<div class="overall-score">
					<span class="overall r_score_<?php 
                echo round($overal_score);
                ?>
"><?php 
                echo round($overal_score, 1);
                ?>
</span>
					<span class="overall-text"><?php 
                _e('Total Score', 'rehub_framework');
                ?>
</span>
				</div>				
			<?php 
            }
            ?>
	
				<div class="review-text">
					<span class="review-header"><?php 
            echo vp_metabox('rehub_post.review_post.0.review_post_heading');
            ?>
</span>
					<p>
						<?php 
            echo wp_kses_post(vp_metabox('rehub_post.review_post.0.review_post_summary_text'));
            ?>
					</p>
				</div>
			</div>
		<?php 
        }
        ?>

		<?php 
        $thecriteria = vp_metabox('rehub_post.review_post.0.review_post_criteria');
        $firstcriteria = $thecriteria[0]['review_post_name'];
        ?>

		<?php 
        if (rehub_option('type_user_review') == 'full_review' && ($postAverage != '0' && $postAverage != '')) {
            ?>

			<div class="rate_bar_wrap_two_reviews">
				<?php 
            if ($firstcriteria) {
                ?>
				<div class="review-criteria">
					<div class="l_criteria"><span class="score_val r_score_<?php 
                echo round(rehub_get_overall_score_editor());
                ?>
"><?php 
                echo rehub_get_overall_score_editor();
                ?>
</span><span class="score_tit"><?php 
                _e('Editor\'s score', 'rehub_framework');
                ?>
</span></div>
					<div class="r_criteria">
						<?php 
                foreach ($thecriteria as $criteria) {
                    ?>
						<?php 
                    $perc_criteria = $criteria['review_post_score'] * 10;
                    ?>
						<div class="rate-bar clearfix" data-percent="<?php 
                    echo $perc_criteria;
                    ?>
%">
							<div class="rate-bar-title"><span><?php 
                    echo $criteria['review_post_name'];
                    ?>
</span></div>
							<div class="rate-bar-bar r_score_<?php 
                    echo round($criteria['review_post_score']);
                    ?>
"></div>
							<div class="rate-bar-percent"><?php 
                    echo $criteria['review_post_score'];
                    ?>
</div>
						</div>
						<?php 
                }
                ?>
					</div>
				</div>
				<?php 
            }
            ?>
				<?php 
            $user_rates = get_post_meta(get_the_ID(), 'post_user_raitings', true);
            $usercriterias = $user_rates['criteria'];
            ?>
				<div class="review-criteria user-review-criteria">
					<div class="l_criteria"><span class="score_val r_score_<?php 
            echo round($postAverage);
            ?>
"><?php 
            echo $postAverage;
            ?>
</span><span class="score_tit"><?php 
            _e('User\'s score', 'rehub_framework');
            ?>
</span></div>
					<div class="r_criteria">
						<?php 
            foreach ($usercriterias as $usercriteria) {
                ?>
						<?php 
                $perc_criteria = $usercriteria['average'] * 10;
                ?>
						<div class="rate-bar user-rate-bar clearfix" data-percent="<?php 
                echo $perc_criteria;
                ?>
%">
							<div class="rate-bar-title"><span><?php 
                echo $usercriteria['name'];
                ?>
</span></div>
							<div class="rate-bar-bar r_score_<?php 
                echo round($usercriteria['average']);
                ?>
"></div>
							<div class="rate-bar-percent"><?php 
                echo $usercriteria['average'];
                ?>
</div>
						</div>
						<?php 
            }
            ?>
					</div>
				</div>
			</div>

		<?php 
        } else {
            ?>

			<?php 
            if ($firstcriteria) {
                ?>
				<div class="review-criteria">
					<?php 
                foreach ($thecriteria as $criteria) {
                    ?>
						<?php 
                    $perc_criteria = $criteria['review_post_score'] * 10;
                    ?>
						<div class="rate-bar clearfix" data-percent="<?php 
                    echo $perc_criteria;
                    ?>
%">
							<div class="rate-bar-title"><span><?php 
                    echo $criteria['review_post_name'];
                    ?>
</span></div>
							<div class="rate-bar-bar r_score_<?php 
                    echo round($criteria['review_post_score']);
                    ?>
"></div>
							<div class="rate-bar-percent"><?php 
                    echo $criteria['review_post_score'];
                    ?>
</div>
						</div>
					<?php 
                }
                ?>
				</div>
			<?php 
            }
            ?>

		<?php 
        }
        ?>

		<?php 
        if (rehub_option('type_user_review') == 'simple') {
            ?>
			<?php 
            if ($overal_score != '0') {
                ?>
				<div class="rating_bar"><?php 
                echo rehub_get_user_rate();
                ?>
</div>
			<?php 
            } else {
                ?>
				<div class="rating_bar no_rev"><?php 
                echo rehub_get_user_rate();
                ?>
</div>
			<?php 
            }
            ?>
		<?php 
        } elseif (rehub_option('type_user_review') == 'full_review') {
            ?>
			<a href="#respond" class="rehub_scroll add_user_review_link"><?php 
            _e("Add your review", "rehub_framework");
            ?>
</a> <?php 
            $comments_count = wp_count_comments(get_the_ID());
            if ($comments_count->total_comments != '') {
                ?>
<span class="add_user_review_link"> &nbsp;|&nbsp; </span><a href="#comments" class="rehub_scroll add_user_review_link"><?php 
                _e("Read reviews and comments", "rehub_framework");
                ?>
</a><?php 
            }
            ?>
		<?php 
        }
        ?>

	</div>


<?php 
    }