1.Загрузить все файлы соответствующим им папкам
2.Открыть файл engine.css
в самом конце добавить:.rati,
.rati1,
.rati2,
.rati3 {
margin-top:3px;
margin-right:5px;
background:#dce5ec url(../img/rat1.png) no-repeat;
width:92px;
height:28px;
text-align:center;
padding-top:12px;
color:#666;
float:left;
//padding-right:6px;
//width:86px;
//background-color:none;
}
.rati1 {color:#fff; background:#a20c0c url(../img/rat3.png) no-repeat; //background-color:none;}
.rati1 a,
.rati2 a {
color:#fff;
}
.rati3 a {color:#000;}
.rati2 {color:#fff; background:#48a20c url(../img/rat2.png) no-repeat; //background-color:none;}
.rati3 {color:#000; background:#ffd58c url(../img/rat4.png) no-repeat; //background-color:none;}
.r1-unit {float:left; position:relative; top:-3px; left:5px; font:18px Verdana; font-weight:bold;}
.r2-unit {float:right; position:relative; top:1px; right:5px; //top:-17px; //right:-2px; font:15px Arial; font-weight:bold;}
3.Открыть файл site.ru/engine/ajax/rating.php,
Найти:if( $go_rate > 5 or $go_rate < 1 ) $go_rate = 0;
Заменить на: if( $go_rate > 5 or $go_rate < -1 ) $go_rate = 0;
4.Открыть файл /engine/modules/functions.php
Найти примерно следующее:function ShowRating($id, $rating, $vote_num, $allow = true) {
global $lang;
...пропущен код...
function userrating($name) {
...пропущен код...
return $rated;
}
Заменить на:function ShowRating($id, $rating, $vote_num, $allow = true) {
global $is_logged, $member_id, $config, $lang, $db;
if ($rating) $rating = round($rating, 0); else $rating = 0;
if (!$allow) {
$rated = <<<HTML
<div class="rati">
<div class="ratig-layer">{$rating}</div>
</div>
HTML;
return $rated;
}
if ($rating < "0") {
$myclass = "1";
}
if ($rating > "0") {
$myclass = "2";
}
if ($rating > "100") {
$myclass = "3";
}
$rated .= <<<HTML
<div class="rati{$myclass}">
<div id="ratig-layer-{$id}">
<div class="ratig-layer">
<a href="#" class="r1-unit" onclick="doRate('-1', '{$id}'); return false;">-</a>
{$rating}
<a href="#" class="r2-unit" onclick="doRate('1', '{$id}'); return false;">+</a>
</div>
</div>
</div>
HTML;
return $rated;
}
function ShortRating($id, $rating, $vote_num, $allow = true) {
global $config, $lang;
if ($rating) $rating = round($rating, 0); else $rating = 0;
if (!$allow) {
$rated = <<<HTML
<div class="rati">
<div class="ratig-layer">{$rating}</div>
</div>
HTML;
return $rated;
}
if ($rating < "0") {
$myclass = "1";
}
if ($rating > "0") {
$myclass = "2";
}
if ($rating > "100") {
$myclass = "3";
}
$rated = "<div id=\"ratig-layer-" . $id . "\">";
$rated .= <<<HTML
<div class="rati{$myclass}">
<div class="ratig-layer">
<a href="#" class="r1-unit" onclick="dleRate('-1', '{$id}'); return false;">-</a>
{$rating}
<a href="#" class="r2-unit" onclick="dleRate('1', '{$id}'); return false;">+</a>
</div>
</div>
HTML;
$rated .= "</div>";
return $rated;
}
function userrating($name) {
global $db;
$row = $db->super_query("SELECT SUM(rating) as rating, SUM(vote_num) as num FROM " . PREFIX . "_post where autor ='$name'");
if ($row['num']) $rating = round(($row['rating'] / $row['num']), 0); else $rating = 0;
$rating = $rating * 17;
$rated = <<<HTML
{$rating}
HTML;
return $rated;
}
Внимание! У вас нет прав для просмотра скрытого текста.