-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_review.php
executable file
·80 lines (78 loc) · 3.56 KB
/
game_review.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!-- vk comments -->
<script type="text/javascript" src="//vk.com/js/api/openapi.js?56"></script>
<script type="text/javascript">VK.init({apiId: 3033594, onlyWidgets: true});</script>
<? if(is_user_logged_in()): ?>
<script type="text/javascript">
function changeVotingResult() {
$.post('/wp-admin/admin-ajax.php', {
action: 'change_voting_result',
post_id: $("#post_id").val(),
votes_count:$("#vote_count").val(),
rating:$("#rate_count").val()
}, function(data) {
if(data.status == "ok") {
$("#rating_update").append('<span style="color: green;">ok</span>');
}
console.log(data);
},"json");
}
</script>
<? endif;?>
<? get_template_part('alphabet') ?>
<!-- Шаблон для вывода игрового обзора, с рейтингом и сбором всех картинок поста в слайдер -->
<div class="single-game complete-block">
<div class="blue-head-block">
<h1><?php the_title() ?></h1>
</div>
<div class="block-content">
<?
$img_data = getPostImages();
if (!empty($img_data)) : ?>
<div id="example" class="simple-slider">
<div id="slides">
<div class="slide-border">
<div class="slider-navigate">
<div class="slide-prev prev"></div>
<div class="slide-next next"></div>
</div>
<div class="slides_container">
<?php foreach($img_data as $img) : ?>
<div class="slide">
<img src="<?php echo $img['url']?>" alt="<?php echo $img['alt'] ?>" width="760" height="460">
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<div id="raiting_star" itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="<?php the_title() ?>">
<div id="raiting_info" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<img src="<?php echo get_template_directory_uri() ?>/img/load.gif" />
<h5>Рейтинг:
<meta itemprop="bestRating" content="10">
<meta itemprop="ratingCount" content="<?=getRatingCount()?>">
<span class="rating-value" itemprop="ratingValue"><?= getPostRating(); ?></span>
<span style="color: #ccc;">
(Голосов: <span class="votes-count"><?=getRatingCount()?></span>)
</span>
<span class="already-voted" style="display: none;">Вы уже голосовали!</span>
</h5>
</div>
<div id="raiting">
<div id="raiting_blank"></div>
<div id="raiting_hover"></div>
<div id="raiting_votes"></div>
</div>
</div>
<? if(is_user_logged_in()): ?>
<div id="rating_update">
Голосов: <input type="text" id="vote_count">
Рейтинг: <input type="text" id="rate_count">
<button onclick="changeVotingResult()">Отправить</button>
</div>
<? endif; ?>
<?php postWithoutImages(); ?>
</div>
</div>