та же проблема. подскажите, что изменилось?
та же проблема. подскажите, что изменилось?
Какой инструкцией пользовались?
<?php
define ( 'RATING_ROOT_DIR', dirname ( __FILE__ ) );
$refresh_time = 86400 * 7; // 86400 время в секундах через которое будет происходить обновление.
$site_name = ""; //Сюда вписываем название вашего сайта.
$filmurl = htmlspecialchars(trim($_REQUEST['url']));
$filmurl_array = parse_url($filmurl);
preg_match('/http:\/\/[w]{0,3}[.]?kinopoisk.ru.*?film\/(\d*)/isu', $filmurl, $id);
$film_id = $id[1];
$filmurl = "http://www.kinopoisk.ru/film/" . $film_id . "/";
if($filmurl_array['host'] == "www.kinopoisk.ru")
{
if(!file_exists( RATING_ROOT_DIR . "/kinopoisk/kp" . $film_id .".png" ) OR (time() - filemtime( RATING_ROOT_DIR . "/kinopoisk/kp" . $film_id .".png")) > $refresh_time )
{
$xml = simplexml_load_file("http://www.kinopoisk.ru/rating/".$film_id.".xml");
if($xml->kp_rating != 0)
{
$kp_rating = substr($xml->kp_rating, 0, 3);
$kp_votes = number_format(intval($xml->kp_rating['num_vote']));
$image = imagecreatefrompng( RATING_ROOT_DIR . "/source/back_kp.png");
$star = imagecreatefrompng( RATING_ROOT_DIR . "/source/star.png");
$font = RATING_ROOT_DIR . "/source/Intermosaic.ttf";
$color = imagecolorallocate($image, 190, 190, 190);
$rating_font = imagecreatefrompng( RATING_ROOT_DIR . "/source/rating_font.png");
$vote_font = imagecreatefrompng( RATING_ROOT_DIR . "/source/votes_font.png");
$rating = explode(".", $kp_rating);
switch(end($rating))
{
case "0": $symbol = 0; break;
case "1": $symbol = 10; $plus = 5; break;
case "2": $symbol = 20; break;
case "3": $symbol = 30; break;
case "4": $symbol = 40; break;
case "5": $symbol = 50; break;
case "6": $symbol = 60; break;
case "7": $symbol = 70; break;
case "8": $symbol = 80; break;
case "9": $symbol = 90; break;
}
switch(reset($rating))
{
case "0": $symbol2 = 0; break;
case "1": $symbol2 = 10;/* $plus2 = 5;*/ break;
case "2": $symbol2 = 20; break;
case "3": $symbol2 = 30; break;
case "4": $symbol2 = 40; break;
case "5": $symbol2 = 50; break;
case "6": $symbol2 = 60; break;
case "7": $symbol2 = 70; break;
case "8": $symbol2 = 80; break;
case "9": $symbol2 = 90; break;
}
imagecopy($image, $rating_font, 93+$plus, 4, $symbol, 0, 10, 10);
imagecopy($image, $rating_font, 88+$plus, 4, 100, 0, 10, 10);
imagecopy($image, $rating_font, 76+$plus+$plus2, 4, $symbol2, 0, 10, 10);
$symbol_count = strlen($kp_votes);
for ($i = 0, $next = 105 - $symbol_count*5; $i != $symbol_count; $i++, $next = $next + 5) {
$symbol = substr($kp_votes, $i, 1);
if($symbol == ",") $symbol = 40; else $symbol = intval($symbol)*4;
imagecopy($image, $vote_font, $next, 18, $symbol, 0, 4, 6);
}
imagettftext($image, 6, 0, 4, 45, $color, $font, $site_name);
for ($i = 0, $next = 0; $i != (int)$kp_rating; $i++, $next = $next + 12) {
imagecopy($image, $star, $next, 27, 0, 0, 10, 10);
}
$half_rating = end(explode(".", $kp_rating));
imagecopy($image, $star, $next, 27, 0, 0, $half_rating, 11);
imagepng($image, RATING_ROOT_DIR . "/kinopoisk/kp". $film_id .".png",9);
} else {
$image = imagecreatefrompng( RATING_ROOT_DIR . "/source/na_kp.png");
}
} else {
$image = imagecreatefrompng( RATING_ROOT_DIR . "/kinopoisk/kp". $film_id .".png");
}
# Display the image
header("Content-type: image/png");
imagepng($image);
} else {
$image = imagecreatefrompng( RATING_ROOT_DIR . "/source/na_kp.png");
header("Content-type: image/png");
imagepng($image);
}
imagedestroy ($image);
?>
<div class="div1"><meta itemprop="ratingValue" content="7.5" />
<a href="/film/669466/votes/" class="continue rating_link rating_ball_green">
<span class="rating_ball">7.532</span>
<span class="ratingCount" itemprop="ratingCount">16 741</span>
</a>
</div>
<?php
define ( 'RATING_ROOT_DIR', dirname ( __FILE__ ) );
$refresh_time = 86400 * 7; // 86400 время в секундах через которое будет происходить обновление.
$site_name = "rupeer.com"; //Сюда вписываем название вашего сайта.
$filmurl = htmlspecialchars(trim($_REQUEST['url']));
$filmurl_array = parse_url($filmurl);
//$film_id = str_replace("/film/","", $filmurl_array['path']);
//$film_id = str_replace(" "," ", $film_id);
$filmurl = "http://www.kinopoisk.ru/film/" . $film_id . "/";
if($filmurl_array['host'] == "www.kinopoisk.ru")
{
if(!file_exists( RATING_ROOT_DIR . "/kinopoisk/kp" . $film_id .".png" ) OR (time() - filemtime( RATING_ROOT_DIR . "/kinopoisk/kp" . $film_id .".png")) > $refresh_time )
{
$film = file_get_contents($filmurl);
preg_match_all('#<div class="div1"><meta itemprop="ratingValue" content="(.*?)".*?<span class="ratingCount" itemprop="ratingCount">(.*?)</span>#isu', $film, $kp, PREG_SET_ORDER);
$kp_rating = $kp[0][1];
$kp_votes = $kp[0][2];
if($kp_rating != 0)
{
$image = imagecreatefrompng( RATING_ROOT_DIR . "/source/back_kp.png");
$star = imagecreatefrompng( RATING_ROOT_DIR . "/source/star.png");
$font = RATING_ROOT_DIR . "/source/Intermosaic.ttf";
$color = imagecolorallocate($image, 190, 190, 190);
$rating_font = imagecreatefrompng( RATING_ROOT_DIR . "/source/rating_font.png");
$vote_font = imagecreatefrompng( RATING_ROOT_DIR . "/source/votes_font.png");
$rating = explode(".", $kp_rating);
switch(end($rating))
{
case "0": $symbol = 0; break;
case "1": $symbol = 10; $plus = 5; break;
case "2": $symbol = 20; break;
case "3": $symbol = 30; break;
case "4": $symbol = 40; break;
case "5": $symbol = 50; break;
case "6": $symbol = 60; break;
case "7": $symbol = 70; break;
case "8": $symbol = 80; break;
case "9": $symbol = 90; break;
}
switch(reset($rating))
{
case "0": $symbol2 = 0; break;
case "1": $symbol2 = 10;/* $plus2 = 5;*/ break;
case "2": $symbol2 = 20; break;
case "3": $symbol2 = 30; break;
case "4": $symbol2 = 40; break;
case "5": $symbol2 = 50; break;
case "6": $symbol2 = 60; break;
case "7": $symbol2 = 70; break;
case "8": $symbol2 = 80; break;
case "9": $symbol2 = 90; break;
}
imagecopy($image, $rating_font, 93+$plus, 4, $symbol, 0, 10, 10);
imagecopy($image, $rating_font, 88+$plus, 4, 100, 0, 10, 10);
imagecopy($image, $rating_font, 76+$plus+$plus2, 4, $symbol2, 0, 10, 10);
$symbol_count = strlen($kp_votes);
for ($i = 0, $next = 105 - $symbol_count*5; $i != $symbol_count; $i++, $next = $next + 5) {
$symbol = substr($kp_votes, $i, 1);
if($symbol == ",") $symbol = 40; else $symbol = intval($symbol)*4;
imagecopy($image, $vote_font, $next, 18, $symbol, 0, 4, 6);
}
imagettftext($image, 6, 0, 4, 45, $color, $font, $site_name);
for ($i = 0, $next = 0; $i != (int)$kp_rating; $i++, $next = $next + 12) {
imagecopy($image, $star, $next, 27, 0, 0, 10, 10);
}
$half_rating = end(explode(".", $kp_rating));
imagecopy($image, $star, $next, 27, 0, 0, $half_rating, 11);
imagepng($image, RATING_ROOT_DIR . "/kinopoisk/kp". $film_id .".png",9);
} else {
$image = imagecreatefrompng( RATING_ROOT_DIR . "/source/na_kp.png");
}
} else {
$image = imagecreatefrompng( RATING_ROOT_DIR . "/kinopoisk/kp". $film_id .".png");
}
# Display the image
header("Content-type: image/png");
imagepng($image);
} else {
$image = imagecreatefrompng( RATING_ROOT_DIR . "/source/na_kp.png");
header("Content-type: image/png");
imagepng($image);
}
imagedestroy ($image);
?>
https://torrentpier.com/threads/kinopoisk-kinopoisk.638/#post-8150 тоже уже не пашетdigma тут еще есть моды по одиночки и они рабочие