вопрос
Всем привет, подскажите как сделать микроразметку рейтинга 10 звезд? Если так ни кто не может или не хочет помочь, готов на платной основе, если что пишите в скайп: shurik290485
Вот мой код functions.php:
код show.full.php:
Вот мой код functions.php:
/основной рейтинг
function ShowRating($id, $rating, $vote_num, $allow = true) {
global $lang;
if( $rating AND $vote_num ) $rating = round( ($rating / $vote_num), 1 );
else $rating = 0;
$rating1 = str_replace( ",", " . ", $rating );
$rating2 = $rating1 * 10;
if( ! $allow ) {
$rated = <<<HTML
<div class="rating">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating2}%;">{$rating2}</li>
</ul>
<div class="rating_digits"><div class="rating_digits_1">Общий бал: {$rating1}</div><div class="rating_digits_2">Проголосовало людей: {$vote_num}</div></div></div>
HTML;
return $rated;
}
$rated .= <<<HTML
<div id='ratig-layer-{$id}'><div class="rating">
<ul class="unit-rating">
<li class="current-rating" style="width:{$rating2}%;">{$rating2}</li>
<li><a href="#" title="1" class="r1-unit" onclick="doRate('1', '{$id}'); return false;">1</a></li>
<li><a href="#" title="2" class="r2-unit" onclick="doRate('2', '{$id}'); return false;">2</a></li>
<li><a href="#" title="3" class="r3-unit" onclick="doRate('3', '{$id}'); return false;">3</a></li>
<li><a href="#" title="4" class="r4-unit" onclick="doRate('4', '{$id}'); return false;">4</a></li>
<li><a href="#" title="5" class="r5-unit" onclick="doRate('5', '{$id}'); return false;">5</a></li>
<li><a href="#" title="6" class="r6-unit" onclick="doRate('6', '{$id}'); return false;">6</a></li>
<li><a href="#" title="7" class="r7-unit" onclick="doRate('7', '{$id}'); return false;">7</a></li>
<li><a href="#" title="8" class="r8-unit" onclick="doRate('8', '{$id}'); return false;">8</a></li>
<li><a href="#" title="9" class="r9-unit" onclick="doRate('9', '{$id}'); return false;">9</a></li>
<li><a href="#" title="10" class="r10-unit" onclick="doRate('10', '{$id}'); return false;">10</a></li>
</ul>
<div class="rating_digits"><div class="rating_digits_1">Общий бал: {$rating1}</div><div class="rating_digits_2">Проголосовало людей: {$vote_num}</div></div></div></div>
HTML;
return $rated;
}
//основной рейтинг
код show.full.php:
<?php
/*
=====================================================
DataLife Engine - by SoftNews Media Group
-----------------------------------------------------
http://dle-news.ru/
-----------------------------------------------------
Copyright (c) 2004,2014 SoftNews Media Group
=====================================================
Данный код защищен авторскими правами
=====================================================
Файл: show.full.php
-----------------------------------------------------
Назначение: Просмотр полной новости и комментариев
=====================================================
*/
if( ! defined( 'DATALIFEENGINE' ) ) {
die( "Hacking attempt!" );
}
$allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] );
$perm = 1;
$i = 0;
$news_found = false;
$allow_full_cache = false;
if( !isset($view_template) ) $view_template ='';
if ( $config['allow_alt_url'] AND !$config['seo_type'] ) $cprefix = "full"; else $cprefix = "full_".$newsid;
$row = dle_cache ( $cprefix, $sql_news );
if( $row ) {
$row = unserialize($row);
if ( !is_array($row) ) die( "Cache data not correct" );
$full_cache = true;
} else {
$row = $db->super_query( $sql_news );
$full_cache = false;
}
$options = news_permission( $row['access'] );
if( $options[$member_id['user_group']] AND $options[$member_id['user_group']] != 3 ) $perm = 1;
if( $options[$member_id['user_group']] == 3 ) $perm = 0;
if( $options[$member_id['user_group']] == 1 ) $user_group[$member_id['user_group']]['allow_addc'] = 0;
if( $options[$member_id['user_group']] == 2 ) $user_group[$member_id['user_group']]['allow_addc'] = 1;
if( $row['id'] AND !$row['approve'] AND $member_id['name'] != $row['autor'] AND !$user_group[$member_id['user_group']]['allow_all_edit'] ) $perm = 0;
if( !$row['approve'] ) $allow_comments = false;
if ($row['id'] AND $config['no_date'] AND !$config['news_future'] AND !$user_group[$member_id['user_group']]['allow_all_edit']) {
if( strtotime($row['date']) > $_TIME ) {
$perm = 0;
}
}
if ($config['category_separator'] != ',') $config['category_separator'] = ' '.$config['category_separator'];
if( ! $row['category'] ) {
$my_cat = "---";
$my_cat_link = "---";
} else {
$my_cat = array ();
$my_cat_link = array ();
$cat_list = explode( ',', $row['category'] );
if( count( $cat_list ) == 1 ) {
if( $allow_list[0] != "all" and ! in_array( $cat_list[0], $allow_list ) ) $perm = 0;
$my_cat[] = $cat_info[$cat_list[0]]['name'];
$my_cat_link = get_categories( $cat_list[0], $config['category_separator'] );
} else {
foreach ( $cat_list as $element ) {
if( $allow_list[0] != "all" and ! in_array( $element, $allow_list ) ) $perm = 0;
if( $element ) {
$my_cat[] = $cat_info[$element]['name'];
if( $config['allow_alt_url'] ) $my_cat_link[] = "<a href=\"" . $config['http_home_url'] . get_url( $element ) . "/\">{$cat_info[$element]['name']}</a>";
else $my_cat_link[] = "<a href=\"$PHP_SELF?do=cat&category={$cat_info[$element]['alt_name']}\">{$cat_info[$element]['name']}</a>";
}
}
$my_cat_link = implode( "{$config['category_separator']} ", $my_cat_link );
}
$my_cat = implode( "{$config['category_separator']} ", $my_cat );
}
if ( $row['id'] AND $perm ) {
if( strtotime($row['date']) >= ($_TIME - 2592000) ) {
$allow_full_cache = true;
}
define( 'NEWS_ID', $row['id'] );
$disable_index = $row['disable_index'];
if ($allow_full_cache AND !$full_cache) create_cache ( $cprefix, serialize($row), $sql_news );
$xfields = xfieldsload();
if( $row['votes'] AND $view_template != "print" ) include_once ENGINE_DIR . '/modules/poll.php';
$category_id = intval( $row['category'] );
if( $view_template == "print" ) $tpl->load_template( 'print.tpl' );
elseif( $category_id and $cat_info[$category_id]['full_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['full_tpl'] . '.tpl' );
else $tpl->load_template( 'fullstory.tpl' );
/* HD Light Add Player Begin */
// Инициализация базового функционала модуля
require_once ENGINE_DIR . '/inc/hdlight/init.php';
// Добавляем плеер
$hdlight->add_player($row);
/* HD Light Add Player Begin */
if( $config['allow_read_count'] AND !$news_page AND !$cstart) {
if ( $config['allow_read_count'] == 2 ) {
$readcount = $db->super_query( "SELECT count(*) as count FROM " . PREFIX . "_read_log WHERE news_id='{$row['id']}' AND ip='{$_IP}'" );
if( !$readcount['count'] ) {
if( $config['cache_count'] ) $db->query( "INSERT INTO " . PREFIX . "_views (news_id) VALUES ('{$row['id']}')" );
else $db->query( "UPDATE " . PREFIX . "_post_extras SET news_read=news_read+1 WHERE news_id='{$row['id']}'" );
$db->query( "INSERT INTO " . PREFIX . "_read_log (news_id, ip) VALUES ('{$row['id']}', '{$_IP}')" );
}
} else {
if( $config['cache_count'] ) $db->query( "INSERT INTO " . PREFIX . "_views (news_id) VALUES ('{$row['id']}')" );
else $db->query( "UPDATE " . PREFIX . "_post_extras SET news_read=news_read+1 WHERE news_id='{$row['id']}'" );
}
}
$news_found = TRUE;
$row['date'] = strtotime( $row['date'] );
if( (strlen( $row['full_story'] ) < 13) and (strpos( $tpl->copy_template, "{short-story}" ) === false) ) {
$row['full_story'] = $row['short_story'];
}
if( ! $news_page ) {
$news_page = 1;
}
if( $config['allow_alt_url'] ) {
if( $config['seo_type'] == 1 OR $config['seo_type'] == 2 ) {
if( $category_id AND $config['seo_type'] == 2 ) {
$c_url = get_url( $category_id );
$full_link = $config['http_home_url'] . $c_url . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
if ($config['seo_control'] AND ( isset($_GET['seourl']) OR strpos ( $_SERVER['REQUEST_URI'], "?" ) !== false ) ) {
if ($_GET['seourl'] != $row['alt_name'] OR $_GET['seocat'] != $c_url OR strpos ( $_SERVER['REQUEST_URI'], "?" ) !== false OR ($_GET['news_page'] == 1 AND $cstart < 2 AND $view_template != "print") OR ($view_template == "print" AND $news_page > 1) ) {
if ($view_template == "print") {
$re_url = explode ( "engine/print.php", strtolower ( $_SERVER['PHP_SELF'] ) );
$re_url = reset ( $re_url );
} else {
$re_url = explode ( "index.php", strtolower ( $_SERVER['PHP_SELF'] ) );
$re_url = reset ( $re_url );
}
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$re_url}{$c_url}/{$row['id']}-{$row['alt_name']}.html");
die("Redirect");
}
}
$print_link = $config['http_home_url'] . $c_url . "/print:page,1," . $row['id'] . "-" . $row['alt_name'] . ".html";
$short_link = $config['http_home_url'] . $c_url . "/";
$row['alt_name'] = $row['id'] . "-" . $row['alt_name'];
$link_page = $config['http_home_url'] . $c_url . "/" . 'page,' . $news_page . ',';
$news_name = $row['alt_name'];
} else {
$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";
if ($config['seo_control'] AND ( isset($_GET['seourl']) OR strpos ( $_SERVER['REQUEST_URI'], "?" ) !== false ) ) {
if ($_GET['seourl'] != $row['alt_name'] OR $_GET['seocat'] OR $_GET['news_name'] OR strpos ( $_SERVER['REQUEST_URI'], "?" ) !== false OR ($_GET['news_page'] == 1 AND $cstart < 2 AND $view_template != "print") OR ($view_template == "print" AND $news_page > 1) ) {
if ($view_template == "print") {
$re_url = explode ( "engine/print.php", strtolower ( $_SERVER['PHP_SELF'] ) );
$re_url = reset ( $re_url );
} else {
$re_url = explode ( "index.php", strtolower ( $_SERVER['PHP_SELF'] ) );
$re_url = reset ( $re_url );
}
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$re_url}{$row['id']}-{$row['alt_name']}.html");
die("Redirect");
}
}
$print_link = $config['http_home_url'] . "print:page,1," . $row['id'] . "-" . $row['alt_name'] . ".html";
$short_link = $config['http_home_url'];
$row['alt_name'] = $row['id'] . "-" . $row['alt_name'];
$link_page = $config['http_home_url'] . 'page,' . $news_page . ',';
$news_name = $row['alt_name'];
}
} else {
$full_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . $row['alt_name'] . ".html";
if ( $config['seo_control'] ) {
if ($_GET['newsid'] OR strpos ( $_SERVER['REQUEST_URI'], "?" ) !== false OR ($_GET['news_page'] == 1 AND $cstart < 2 AND $view_template != "print") OR ($view_template == "print" AND $news_page > 1) ) {
if ($view_template == "print") {
$re_url = explode ( "engine/print.php", strtolower ( $_SERVER['PHP_SELF'] ) );
$re_url = reset ( $re_url );
} else {
$re_url = explode ( "index.php", strtolower ( $_SERVER['PHP_SELF'] ) );
$re_url = reset ( $re_url );
}
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$re_url}".date( 'Y/m/d/', $row['date'] ).$row['alt_name'].".html");
die("Redirect");
}
}
$print_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . "print:page,1," . $row['alt_name'] . ".html";
$short_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] );
$link_page = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . 'page,' . $news_page . ',';
$news_name = $row['alt_name'];
}
} else {
$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id'];
$print_link = $config['http_home_url'] . "engine/print.php?newsid=" . $row['id'];
$short_link = "";
$link_page = "";
$news_name = "";
}
$i ++;
//
// обработка страниц
//
$news_seiten = explode( "{PAGEBREAK}", $row['full_story'] );
$anzahl_seiten = count( $news_seiten );
if( $news_page <= 0 OR $news_page > $anzahl_seiten OR (isset($_GET['news_page']) AND $_GET['news_page'] === "0") ) {
$news_page = 1;
if ( $config['seo_control'] ) {
$re_url = str_replace( $config['http_home_url'], "/", $full_link );
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$re_url}");
die("Redirect");
}
}
if( $view_template == "print" ) {
$row['full_story'] = str_replace( "{PAGEBREAK}", "", $row['full_story'] );
$row['full_story'] = preg_replace( "'\[page=(.*?)\](.*?)\[/page\]'si", "\\2", $row['full_story'] );
$tpl->set_block( "'\\[pages\\](.*?)\\[/pages\\]'si", "" );
$tpl->set( '{pages}', "" );
} else {
$row['full_story'] = $news_seiten[$news_page - 1];
$row['full_story'] = preg_replace( '#(\A[\s]*<br[^>]*>[\s]*|<br[^>]*>[\s]*\Z)#is', '', $row['full_story'] ); // remove <br/> at end of string
$news_seiten = "";
unset( $news_seiten );
if( $anzahl_seiten > 1 ) {
$tpl2 = new dle_template();
$tpl2->dir = TEMPLATE_DIR;
$tpl2->load_template( 'splitnewsnavigation.tpl' );
if( $news_page < $anzahl_seiten ) {
$pages = $news_page + 1;
if( $config['allow_alt_url'] ) {
$nextpage = "<a href=\"" . $short_link . "page," . $pages . "," . $row['alt_name'] . ".html\">";
} else {
$nextpage = "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&news_page=" . $pages . "\">";
}
$tpl2->set( '[next-link]', $nextpage );
$tpl2->set( '[/next-link]', "</a>" );
} else {
$tpl2->set_block( "'\\[next-link\\](.*?)\\[/next-link\\]'si", "<span>\\1</span>" );
}
if( $news_page > 1 ) {
$pages = $news_page - 1;
if( $config['allow_alt_url'] ) {
if ( $pages == 1 ) $prevpage = "<a href=\"" . $full_link . "\">";
else $prevpage = "<a href=\"" . $short_link . "page," . $pages . "," . $row['alt_name'] . ".html\">";
} else {
if ( $pages == 1 ) $prevpage = "<a href=\"" . $full_link. "\">";
else $prevpage = "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&news_page=" . $pages . "\">";
}
$tpl2->set( '[prev-link]', $prevpage );
$tpl2->set( '[/prev-link]', "</a>" );
} else {
$tpl2->set_block( "'\\[prev-link\\](.*?)\\[/prev-link\\]'si", "<span>\\1</span>" );
}
$listpages ="";
if( $anzahl_seiten <= 10 ) {
for($j = 1; $j <= $anzahl_seiten; $j ++) {
if( $j != $news_page ) {
if( $config['allow_alt_url'] ) {
if ($j == 1)
$listpages .= "<a href=\"" . $full_link . "\">$j</a> ";
else
$listpages .= "<a href=\"" . $short_link . "page," . $j . "," . $row['alt_name'] . ".html\">$j</a> ";
} else {
if ($j == 1)
$listpages .= "<a href=\"{$full_link}\">$j</a> ";
else
$listpages .= "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&news_page=" . $j . "\">$j</a> ";
}
} else {
$listpages .= "<span>$j</span> ";
}
}
} else {
$start = 1;
$end = 10;
$nav_prefix = "<span class=\"nav_ext\">{$lang['nav_trennen']}</span> ";
if( $news_page > 1 ) {
if( $news_page > 6 ) {
$start = $news_page - 4;
$end = $start + 8;
if( $end >= $anzahl_seiten ) {
$start = $anzahl_seiten - 9;
$end = $anzahl_seiten - 1;
$nav_prefix = "";
} else
$nav_prefix = "<span class=\"nav_ext\">{$lang['nav_trennen']}</span> ";
}
}
if( $start >= 2 ) {
$listpages .= "<a href=\"" . $full_link . "\">1</a> <span class=\"nav_ext\">{$lang['nav_trennen']}</span> ";
}
for($j = $start; $j <= $end; $j ++) {
if( $j != $news_page ) {
if( $config['allow_alt_url'] ) {
if ($j == 1)
$listpages .= "<a href=\"" . $full_link . "\">$j</a> ";
else
$listpages .= "<a href=\"" . $short_link . "page," . $j . "," . $row['alt_name'] . ".html\">$j</a> ";
} else {
if ($j == 1)
$listpages .= "<a href=\"{$full_link}\">$j</a> ";
else
$listpages .= "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&news_page=" . $j . "\">$j</a> ";
}
} else {
$listpages .= "<span>$j</span> ";
}
}
if( $news_page != $anzahl_seiten ) {
if( $config['allow_alt_url'] ) $listpages .= $nav_prefix . "<a href=\"" . $short_link . "page," . $anzahl_seiten . "," . $row['alt_name'] . ".html\">{$anzahl_seiten}</a>";
else $listpages .= $nav_prefix . "<a href=\"$PHP_SELF?newsid=" . $row['id'] . "&news_page=" . $anzahl_seiten . "\">{$anzahl_seiten}</a>";
} else
$listpages .= "<span>{$anzahl_seiten}</span> ";
}
&n