本文整理汇总了PHP中STReview::get_avg_rate方法的典型用法代码示例。如果您正苦于以下问题:PHP STReview::get_avg_rate方法的具体用法?PHP STReview::get_avg_rate怎么用?PHP STReview::get_avg_rate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类STReview
的用法示例。
在下文中一共展示了STReview::get_avg_rate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _e
</div>
<div class="row mt10">
<div class="col-md-6 col-sm-6 col-xs-6">
<p class="mb0 text-darken">
<i class="fa fa-money"> </i>
<?php
_e('Price', ST_TEXTDOMAIN);
?>
:
<span> <?php
echo STHoliday::get_price_html(false, false, ' <br> -');
?>
</span>
</p>
</div>
<div class="col-md-6 col-sm-6 col-xs-6 text-right">
<i class="fa fa-thumbs-o-up icon-like"> </i>
<ul class="icon-group text-color pull-right">
<?php
echo TravelHelper::rate_to_string(STReview::get_avg_rate());
?>
</ul>
</div>
</div>
</div>
</div>
<div class="gap"></div>
</div>
示例2: count
$count += count($gallery);
foreach ($gallery as $key => $value) {
$img_link = wp_get_attachment_image_src($value, array(800, 600, 'bfi_thumb' => TRUE));
if (isset($img_link[0])) {
echo "<a class='st-gp-item' href='{$img_link[0]}'></a>";
}
}
}
?>
</div>
</div>
</header>
<div class="thumb-caption">
<ul class="icon-group text-tiny text-color">
<?php
$avg = STReview::get_avg_rate();
echo TravelHelper::rate_to_string($avg);
?>
</ul>
<h5 class="thumb-title"><a class="text-darken"
href="<?php
echo esc_url($link);
?>
"><?php
the_title();
?>
</a></h5>
<?php
if ($address = get_post_meta(get_the_ID(), 'address', TRUE)) {
?>
<p class="mb0">
示例3: save_comment_meta_data
function save_comment_meta_data($comment_id)
{
if (isset($_POST['comment_title']) && $_POST['comment_title'] != '') {
$title = wp_filter_nohtml_kses($_POST['comment_title']);
add_comment_meta($comment_id, 'comment_title', $title);
}
if (isset($_POST['comment_rate']) && $_POST['comment_rate'] != '') {
$rate = wp_filter_nohtml_kses($_POST['comment_rate']);
if ($rate > 5) {
//Max rate is 5
$rate = 5;
}
add_comment_meta($comment_id, ' q', $rate);
}
$all_postype = st()->booking_post_type();
$current_post_type = get_post_type(get_comment($comment_id)->comment_post_ID);
global $wpdb;
$wpdb->update($wpdb->comments, array('comment_type' => 'st_reviews'), array('comment_ID' => $comment_id));
$comemntObj = get_comment($comment_id);
$post_id = $comemntObj->comment_post_ID;
$avg = STReview::get_avg_rate($post_id);
update_post_meta($post_id, 'rate_review', $avg);
}
示例4: _update_duplicate_data
function _update_duplicate_data($id, $data)
{
if (!TravelHelper::checkTableDuplicate('st_rental')) {
return;
}
if (get_post_type($id) == 'st_rental') {
$num_rows = TravelHelper::checkIssetPost($id, 'st_rental');
$location_str = get_post_meta($id, 'multi_location', true);
$location_id = '';
// location_id
$address = get_post_meta($id, 'address', true);
// address
$rentals_booking_period = get_post_meta($id, 'rentals_booking_period', true);
// rentals_booking_period
$rental_max_adult = get_post_meta($id, 'rental_max_adult', true);
// rental max adult
$rental_max_children = get_post_meta($id, 'rental_max_children', true);
// rental max children
$sale_price = get_post_meta($id, 'price', true);
// sale price
$discount = get_post_meta($id, 'discount_rate', true);
$is_sale_schedule = get_post_meta($id, 'is_sale_schedule', true);
if ($is_sale_schedule == 'on') {
$sale_from = get_post_meta($id, 'sale_price_from', true);
$sale_to = get_post_meta($id, 'sale_price_to', true);
if ($sale_from and $sale_from) {
$today = date('Y-m-d');
$sale_from = date('Y-m-d', strtotime($sale_from));
$sale_to = date('Y-m-d', strtotime($sale_to));
if ($today >= $sale_from && $today <= $sale_to) {
} else {
$discount = 0;
}
} else {
$discount = 0;
}
}
if ($discount) {
$sale_price = $sale_price - $sale_price / 100 * $discount;
}
$rate_review = STReview::get_avg_rate($id);
// rate review
if ($num_rows == 1) {
$data = array('multi_location' => $location_str, 'location_id' => $location_id, 'address' => $address, 'rental_max_adult' => $rental_max_adult, 'rental_max_children' => $rental_max_children, 'rate_review' => $rate_review, 'sale_price' => $sale_price, 'rentals_booking_period' => $rentals_booking_period);
$where = array('post_id' => $id);
TravelHelper::updateDuplicate('st_rental', $data, $where);
} elseif ($num_rows == 0) {
$data = array('post_id' => $id, 'multi_location' => $location_str, 'location_id' => $location_id, 'address' => $address, 'rental_max_adult' => $rental_max_adult, 'rental_max_children' => $rental_max_children, 'rate_review' => $rate_review, 'sale_price' => $sale_price, 'rentals_booking_period' => $rentals_booking_period);
TravelHelper::insertDuplicate('st_rental', $data);
}
}
}
示例5: _save_review_stats
/**
* @since 1.1.9
* @param $comment_id
*/
function _save_review_stats($comment_id)
{
$comemntObj = get_comment($comment_id);
$post_id = $comemntObj->comment_post_ID;
if (get_post_type($post_id) == 'st_holidays') {
$all_stats = $this->get_review_stats();
$st_review_stats = STInput::post('st_review_stats');
if (!empty($all_stats) and is_array($all_stats)) {
$total_point = 0;
foreach ($all_stats as $key => $value) {
if (isset($st_review_stats[$value['title']])) {
$total_point += $st_review_stats[$value['title']];
//Now Update the Each Stat Value
update_comment_meta($comment_id, 'st_stat_' . sanitize_title($value['title']), $st_review_stats[$value['title']]);
}
}
$avg = round($total_point / count($all_stats), 1);
//Update comment rate with avg point
$rate = wp_filter_nohtml_kses($avg);
if ($rate > 5) {
//Max rate is 5
$rate = 5;
}
update_comment_meta($comment_id, 'comment_rate', $rate);
//Now Update the Stats Value
update_comment_meta($comment_id, 'st_review_stats', $st_review_stats);
}
if (STInput::post('comment_rate')) {
update_comment_meta($comment_id, 'comment_rate', STInput::post('comment_rate'));
}
//review_stats
$avg = STReview::get_avg_rate($post_id);
update_post_meta($post_id, 'rate_review', $avg);
}
}
示例6: balanceTags
echo balanceTags($img);
} else {
echo '<img width="800" height="600" alt="no-image" class="wp-post-image" src="' . bfi_thumb(get_template_directory_uri() . '/img/no-image.png', array('width' => 800, 'height' => 600)) . '">';
}
?>
</div>
<div class="col-md-6">
<div class="booking-item-rating">
<ul class="icon-group booking-item-rating-stars">
<?php
echo TravelHelper::rate_to_string(STReview::get_avg_rate());
?>
</ul>
<span class="booking-item-rating-number">
<b><?php
echo STReview::get_avg_rate();
?>
</b> <?php
st_the_language('user_of_5');
?>
</span>
<small>
(<?php
comments_number(st_get_language('user_no_reviews'), st_get_language('user_1_review'), '% ' . st_get_language('user_reviews'));
?>
)
</small>
</div>
<h5 class="booking-item-title"><?php
the_title();
?>
示例7: get_the_post_thumbnail
?>
<a class="booking-item-payment-img" href="#">
<?php
echo get_the_post_thumbnail($id_activity, array(98, 74, 'bfi_thumb' => true));
?>
</a>
<h5 class="booking-item-payment-title"><a href="<?php
echo get_permalink($id_activity);
?>
"><?php
echo get_the_title($id_activity);
?>
</a></h5>
<ul class="icon-group booking-item-rating-stars">
<?php
echo TravelHelper::rate_to_string(STReview::get_avg_rate($id_activity));
?>
</ul>
<?php
} else {
st_the_language('sorry_activity_not_found');
}
?>
</header>
<ul class="booking-item-payment-details">
<?php
if (!empty($check_in) and !empty($check_out)) {
?>
<li>
<h5><?php
st_the_language('activity');
示例8: save_post_review_stats
function save_post_review_stats($comment_id)
{
$comemntObj = get_comment($comment_id);
$post_id = $comemntObj->comment_post_ID;
$avg = STReview::get_avg_rate($post_id);
update_post_meta($post_id, 'rate_review', $avg);
}
示例9: _update_duplicate_data
function _update_duplicate_data($id, $data)
{
if (!TravelHelper::checkTableDuplicate('st_holidays')) {
return;
}
if (get_post_type($id) == 'st_holidays') {
$num_rows = TravelHelper::checkIssetPost($id, 'st_holidays');
$location_str = get_post_meta($id, 'multi_location', true);
$location_id = '';
// location_id
$address = get_post_meta($id, 'address', true);
// address
$max_people = get_post_meta($id, 'max_people', true);
// maxpeople
$check_in = get_post_meta($id, 'check_in', true);
// check in
$check_out = get_post_meta($id, 'check_out', true);
// check out
$type_holiday = get_post_meta($id, 'type_holiday', true);
// check out
$duration_day = get_post_meta($id, 'duration_day', true);
// duration_day
$holidays_booking_period = get_post_meta($id, 'holidays_booking_period', true);
// holidays_booking_period
$sale_price = get_post_meta($id, 'price', true);
// sale_price
$child_price = get_post_meta($id, 'child_price', true);
$adult_price = get_post_meta($id, 'adult_price', true);
$infant_price = get_post_meta($id, 'infant_price', true);
$discount = get_post_meta($id, 'discount', true);
$is_sale_schedule = get_post_meta($id, 'is_sale_schedule', true);
if ($is_sale_schedule == 'on') {
$sale_from = get_post_meta($id, 'sale_price_from', true);
$sale_to = get_post_meta($id, 'sale_price_to', true);
if ($sale_from and $sale_from) {
$today = date('Y-m-d');
$sale_from = date('Y-m-d', strtotime($sale_from));
$sale_to = date('Y-m-d', strtotime($sale_to));
if ($today >= $sale_from && $today <= $sale_to) {
} else {
$discount = 0;
}
} else {
$discount = 0;
}
}
if ($discount) {
$sale_price = $sale_price - $sale_price / 100 * $discount;
$child_price = $child_price - $child_price / 100 * $discount;
$adult_price = $adult_price - $adult_price / 100 * $discount;
$infant_price = $infant_price - $infant_price / 100 * $discount;
}
$rate_review = STReview::get_avg_rate($id);
// rate review
if ($num_rows == 1) {
$data = array('multi_location' => $location_str, 'id_location' => $location_id, 'address' => $address, 'type_holiday' => $type_holiday, 'check_in' => $check_in, 'check_out' => $check_out, 'sale_price' => $sale_price, 'child_price' => $child_price, 'adult_price' => $adult_price, 'infant_price' => $infant_price, 'max_people' => $max_people, 'rate_review' => $rate_review, 'duration_day' => $duration_day, 'holidays_booking_period' => $holidays_booking_period);
$where = array('post_id' => $id);
TravelHelper::updateDuplicate('st_holidays', $data, $where);
} elseif ($num_rows == 0) {
$data = array('post_id' => $id, 'multi_location' => $location_str, 'id_location' => $location_id, 'address' => $address, 'type_holiday' => $type_holiday, 'check_in' => $check_in, 'check_out' => $check_out, 'sale_price' => $sale_price, 'child_price' => $child_price, 'adult_price' => $adult_price, 'infant_price' => $infant_price, 'max_people' => $max_people, 'rate_review' => $rate_review, 'duration_day' => $duration_day, 'holidays_booking_period' => $holidays_booking_period);
TravelHelper::insertDuplicate('st_holidays', $data);
}
}
}
示例10: st
?>
<div class="thumb item_map">
<header class="thumb-header">
<img src="<?php
echo $img;
?>
" alt="" class="img-responsive">
</header>
<div class="thumb-caption">
<?php
$view_star_review = st()->get_option('view_star_review', 'review');
if ($view_star_review == 'review') {
?>
<ul class="icon-group text-color">
<?php
$avg = STReview::get_avg_rate($hotel_id);
echo TravelHelper::rate_to_string($avg);
?>
</ul>
<?php
} elseif ($view_star_review == 'star') {
?>
<ul class="icon-list icon-group booking-item-rating-stars text-color">
<?php
$star = STHotel::getStar($hotel_id);
echo TravelHelper::rate_to_string($star);
?>
</ul>
<?php
}
?>
示例11: update_avg_rate
function update_avg_rate($post_id)
{
$avg = STReview::get_avg_rate($post_id);
update_post_meta($post_id, 'rate_review', $avg);
}
示例12: _update_duplicate_data
/**
*@since 1.1.8
**/
function _update_duplicate_data($id, $data)
{
if (!TravelHelper::checkTableDuplicate('st_hotel')) {
return;
}
if (get_post_type($id) == 'st_hotel') {
$num_rows = TravelHelper::checkIssetPost($id, 'st_hotel');
$location_str = get_post_meta($id, 'multi_location', true);
$location_id = '';
// location_id
$address = get_post_meta($id, 'address', true);
// address
$allow_full_day = get_post_meta($id, 'allow_full_day', true);
// address
$rate_review = STReview::get_avg_rate($id);
// rate review
$hotel_star = get_post_meta($id, 'hotel_star', true);
// hotel star
$price_avg = get_post_meta($id, 'price_avg', true);
// price avg
$hotel_booking_period = get_post_meta($id, 'hotel_booking_period', true);
// price avg
$map_lat = get_post_meta($id, 'map_lat', true);
// map_lat
$map_lng = get_post_meta($id, 'map_lng', true);
// map_lng
if ($num_rows == 1) {
$data = array('multi_location' => $location_str, 'id_location' => $location_id, 'address' => $address, 'allow_full_day' => $allow_full_day, 'rate_review' => $rate_review, 'hotel_star' => $hotel_star, 'price_avg' => $price_avg, 'hotel_booking_period' => $hotel_booking_period, 'map_lat' => $map_lat, 'map_lng' => $map_lng);
$where = array('post_id' => $id);
TravelHelper::updateDuplicate('st_hotel', $data, $where);
} elseif ($num_rows == 0) {
$data = array('post_id' => $id, 'multi_location' => $location_str, 'id_location' => $location_id, 'address' => $address, 'allow_full_day' => $allow_full_day, 'rate_review' => $rate_review, 'hotel_star' => $hotel_star, 'price_avg' => $price_avg, 'hotel_booking_period' => $hotel_booking_period, 'map_lat' => $map_lat, 'map_lng' => $map_lng);
TravelHelper::insertDuplicate('st_hotel', $data);
}
}
}
示例13: get_the_post_thumbnail
?>
<a class="booking-item-payment-img" href="#">
<?php
echo get_the_post_thumbnail($holiday_id, array(98, 74, 'bfi_thumb' => true));
?>
</a>
<h5 class="booking-item-payment-title"><a href="<?php
echo get_permalink($holiday_id);
?>
"><?php
echo get_the_title($holiday_id);
?>
</a></h5>
<ul class="icon-group booking-item-rating-stars">
<?php
echo TravelHelper::rate_to_string(STReview::get_avg_rate($holiday_id));
?>
</ul>
<?php
} else {
st_the_language('sorry_holiday_not_found');
}
?>
</header>
<ul class="booking-item-payment-details">
<li>
<h5><?php
st_the_language('holidays_information');
?>
</h5>
<p class="booking-item-payment-item-title"><?php
示例14: elseif
<?php
/**
* @package WordPress
* @subpackage Traveler
* @since 1.0
*
* Rental review summary
*
* Created by ShineTheme
*
*/
$avg = (double) STReview::get_avg_rate();
?>
<div class="booking-item-meta">
<?php
if ($avg >= 2) {
?>
<h2 class="lh1em">
<?php
if ($avg < 2) {
} elseif ($avg <= 3) {
st_the_language('rental_pleasant');
} elseif ($avg <= 4) {
st_the_language('rental_good');
} elseif ($avg < 5) {
st_the_language('rental_very_good');
} elseif ($avg == 5) {
st_the_language('rental_wonderful');
}
?>
示例15: esc_url
<h5 class="booking-item-title" <?php
if ($layout == 'layout2') {
echo 'style="font-size: 20px;"';
}
?>
><a href="<?php
echo esc_url($link);
?>
"><?php
echo get_the_title($post_id);
?>
</a> </h5>
<ul class="icon-group booking-item-rating-stars">
<?php
if ($instance['post_type'] != 'st_cars') {
$avg = STReview::get_avg_rate($post_id);
echo TravelHelper::rate_to_string($avg);
}
?>
</ul>
</div>
<div class="<?php
if ($layout == 'layout2') {
echo 'col-xs-12';
} else {
echo 'col-xs-3';
}
?>
">
<?php
switch ($instance['post_type']) {