вопрос
Сам вопрос как сделать вывод двумя тегами а не общии как сейчас
<?
if( ! defined( 'DATALIFEENGINE' ) ) {
die( "Hacking attempt!" );
}
$cacheid = $row['id'];
$all = unserialize(dle_cache( "kino_rating"."_".$cacheid, $config['skin'] ));
$kino_rating = $all[0];
$kino_votes = $all[1];
$imdb_rating = $all[2];
$imdb_votes = $all[3];
$timeout = stream_context_create( array (
'http' => array(
'timeout' => 1
)
)
);
if ($all =='') {
$all = array();
$kinopoisk = xfieldsdataload($row['xfields']);
$kinopoisk['kp'] = preg_replace('#<(.+?)>#', '', $kinopoisk['kp']);
$kinopoisk = $kinopoisk['kp'];
$rating = file_get_contents("http://rating.kinopoisk.ru/{$kinopoisk}.xml", 0, $timeout);
preg_match("/kp_rating num_vote=['\"](.+)['\"]>(.+)</isU", $rating, $kp);
$kino_rating = $kp[2];
$kino_votes = ($kino_rating) ? $kp[1] : "";
$kino_votes = $kino_votes;
preg_match("/imdb_rating num_vote=['\"](.+)['\"]>(.+)</isU", $rating, $imdb);
$imdb_rating = $imdb[2];
$imdb_votes = ($imdb_rating) ? $imdb[1] : "";
$imdb_votes = $imdb_votes;
$all = array( $kino_rating, $kino_votes, $imdb_rating, $imdb_votes);
create_cache( "kino_rating"."_".$cacheid, serialize($all), $config['skin'] );
}
if ($imdb_rating =='' or $imdb_rating =='0') {
$kino_rate = round(($kino_rating), 1);
$sum_vote = number_format($kino_votes);
} elseif ($kino_rating =='0' or $kino_rating =='') {
$kino_rate = round(($imdb_rating), 1);
$sum_vote = number_format($imdb_votes);
} else {
$kino_rate = round(($kino_rating+$imdb_rating)/2, 1);
$sum_vote = number_format(($kino_votes+$imdb_votes)/2);
};
$tpl->set('{kinopoisk}', $kino_rate);
$tpl->set('{kinopoisk_vote}', $sum_vote);
?>
<?
if( ! defined( 'DATALIFEENGINE' ) ) {
die( "Hacking attempt!" );
}
$cacheid = $row['id'];
$all = unserialize(dle_cache( "kino_rating"."_".$cacheid, $config['skin'] ));
$kino_rating = $all[0];
$kino_votes = $all[1];
$imdb_rating = $all[2];
$imdb_votes = $all[3];
$timeout = stream_context_create( array (
'http' => array(
'timeout' => 1
)
)
);
if ($all =='') {
$all = array();
$kinopoisk = xfieldsdataload($row['xfields']);
$kinopoisk['kp'] = preg_replace('#<(.+?)>#', '', $kinopoisk['kp']);
$kinopoisk = $kinopoisk['kp'];
$rating = file_get_contents("http://rating.kinopoisk.ru/{$kinopoisk}.xml", 0, $timeout);
preg_match("/kp_rating num_vote=['\"](.+)['\"]>(.+)</isU", $rating, $kp);
$kino_rating = $kp[2];
$kino_votes = ($kino_rating) ? $kp[1] : "";
$kino_votes = $kino_votes;
preg_match("/imdb_rating num_vote=['\"](.+)['\"]>(.+)</isU", $rating, $imdb);
$imdb_rating = $imdb[2];
$imdb_votes = ($imdb_rating) ? $imdb[1] : "";
$imdb_votes = $imdb_votes;
$all = array( $kino_rating, $kino_votes, $imdb_rating, $imdb_votes);
create_cache( "kino_rating"."_".$cacheid, serialize($all), $config['skin'] );
create_cache( "imdb_rating"."_".$cacheid, serialize($all), $config['skin'] );
}
if ($imdb_rating =='0' or $imdb_rating =='') {
$imdb_rate = round(($imdb_rating), 1);
$imdb_vote = number_format($imdb_votes);
} else {
$imdb_rate = round(($imdb_rating)2, 1);
$imdb_vote = number_format(($imdb_votes)2);
}
if ($kino_rating =='0' or $kino_rating =='') {
$kino_rate = round(($kino_rating), 1);
$sum_vote = number_format($kino_votes);
} else {
$kino_rate = round(($kino_rating)2, 1);
$sum_vote = number_format(($kino_votes)2);
};
$tpl->set('{kinopoisk}', $kino_rate);
$tpl->set('{kinopoisk_vote}', $sum_vote);
$tpl->set('{imdb}', $imdb_rate);
$tpl->set('{imdb_vote}', $imdb_vote);
?>