вопрос
Всем добрый день! помогите разобраться с Микроразметкой рейтинга полной новости в DLE 14,0 как ее настроить ?
для такого вида
В fullstory.tpl сейчас у меня так .
В show.full.php так
для такого вида
В fullstory.tpl сейчас у меня так .
<div class="rating-stars">
{rating}
</div>
<div class="rating-title">
Оцените рецепт
</div>
<div class="rating-stat">
Рейтинг: {ratingscore} из 5. Голосов: {vote-num}
</div>
</div>
В show.full.php так
if ( $config['rating_type'] == "1" ) {
$tpl->set( '[rating-type-2]', "" );
$tpl->set( '[/rating-type-2]', "" );
$tpl->set_block( "'\\[rating-type-1\\](.*?)\\[/rating-type-1\\]'si", "" );
$tpl->set_block( "'\\[rating-type-3\\](.*?)\\[/rating-type-3\\]'si", "" );
$tpl->set_block( "'\\[rating-type-4\\](.*?)\\[/rating-type-4\\]'si", "" );
} elseif ( $config['rating_type'] == "2" ) {
$tpl->set( '[rating-type-3]', "" );
$tpl->set( '[/rating-type-3]', "" );
$tpl->set_block( "'\\[rating-type-1\\](.*?)\\[/rating-type-1\\]'si", "" );
$tpl->set_block( "'\\[rating-type-2\\](.*?)\\[/rating-type-2\\]'si", "" );
$tpl->set_block( "'\\[rating-type-4\\](.*?)\\[/rating-type-4\\]'si", "" );
} elseif ( $config['rating_type'] == "3" ) {
$tpl->set( '[rating-type-4]', "" );
$tpl->set( '[/rating-type-4]', "" );
$tpl->set_block( "'\\[rating-type-1\\](.*?)\\[/rating-type-1\\]'si", "" );
$tpl->set_block( "'\\[rating-type-2\\](.*?)\\[/rating-type-2\\]'si", "" );
$tpl->set_block( "'\\[rating-type-3\\](.*?)\\[/rating-type-3\\]'si", "" );
} else {
$tpl->set( '[rating-type-1]', "" );
$tpl->set( '[/rating-type-1]', "" );
$tpl->set_block( "'\\[rating-type-4\\](.*?)\\[/rating-type-4\\]'si", "" );
$tpl->set_block( "'\\[rating-type-3\\](.*?)\\[/rating-type-3\\]'si", "" );
$tpl->set_block( "'\\[rating-type-2\\](.*?)\\[/rating-type-2\\]'si", "" );
}
if( $row['allow_rate'] ) {
$dislikes = ($row['vote_num'] - $row['rating'])/2;
$likes = $row['vote_num'] - $dislikes;
$tpl->set( '{likes}', "<span id=\"likes-id-".$row['id']."\" class=\"ignore-select\">".$likes."</span>" );
$tpl->set( '{dislikes}', "<span id=\"dislikes-id-".$row['id']."\" class=\"ignore-select\">".$dislikes."</span>" );
$tpl->set( '{rating}', ShowRating( $row['id'], $row['rating'], $row['vote_num'], $user_group[$member_id['user_group']]['allow_rating'] ) );
$tpl->set( '{vote-num}', "<span id=\"vote-num-id-".$row['id']."\">".$row['vote_num']."</span>" );
$tpl->set( '[rating]', "" );
$tpl->set( '[/rating]', "" );
if( $row['vote_num'] ) $ratingscore = str_replace( ',', '.', round( ($row['rating'] / $row['vote_num']), 1 ) );
else $ratingscore = 0;
$tpl->set( '{ratingscore}', $ratingscore );
if( $user_group[$member_id['user_group']]['allow_rating'] ) {
if ( $config['rating_type'] ) {
$tpl->set( '[rating-plus]', "<a href=\"#\" onclick=\"doRate('plus', '{$row['id']}'); return false;\" >" );
$tpl->set( '[/rating-plus]', '</a>' );
if ( $config['rating_type'] == "2" OR $config['rating_type'] == "3") {
$tpl->set( '[rating-minus]', "<a href=\"#\" onclick=\"doRate('minus', '{$row['id']}'); return false;\" >" );
$tpl->set( '[/rating-minus]', '</a>' );
} else {
$tpl->set_block( "'\\[rating-minus\\](.*?)\\[/rating-minus\\]'si", "" );
}
} else {
$tpl->set_block( "'\\[rating-plus\\](.*?)\\[/rating-plus\\]'si", "" );
$tpl->set_block( "'\\[rating-minus\\](.*?)\\[/rating-minus\\]'si", "" );
}
} else {
$tpl->set_block( "'\\[rating-plus\\](.*?)\\[/rating-plus\\]'si", "" );
$tpl->set_block( "'\\[rating-minus\\](.*?)\\[/rating-minus\\]'si", "" );
}
} else {
$tpl->set( '{rating}', "" );
$tpl->set( '{vote-num}', "" );
$tpl->set( '{likes}', "" );
$tpl->set( '{dislikes}', "" );
$tpl->set( '{ratingscore}', "" );
$tpl->set_block( "'\\[rating\\](.*?)\\[/rating\\]'si", "" );
$tpl->set_block( "'\\[rating-plus\\](.*?)\\[/rating-plus\\]'si", "" );
$tpl->set_block( "'\\[rating-minus\\](.*?)\\[/rating-minus\\]'si", "" );
}