volkodav2000
Пользователь
этот code избавляет от двух лишних фаилов, по которим узверь может зайти прямой ссилкой типа: - у меня летели нотисы. Ну и внедряет ето все дело в родной ajax.php.
--- добавлено: Dec 30, 2011 10:59 PM ---
displaying_torrents.php
viewtopic_attach.tpl
misc/css/rating.css
--- добавлено: Dec 30, 2011 10:59 PM ---
displaying_torrents.php
PHP:
$stars = array('one','two','three','four','five');
$rate_on = '<ul class="rating';
if($rating_sum && $rating_count>0) {
$rate_on .= ' '.$stars[round($rating_sum/$rating_count,1)-1].'star">';
}
else {$rate_on .='">';}
for ($r = 1; $r <= 5; $r++ ) {
$rate_on .= '<li class="'.$stars[($r-1)].'"><a href="#torrent" title="'.$lang['RATING_'.$r].'" onClick="rate('.$attach_id.','.$r.');"></a></li>';
}
$rate_on .='</ul>';
$rate_off = '<ul class="rating';
if($rating_sum && $rating_count>0) {
$rate_off .= ' '.$stars[round($rating_sum/$rating_count,1)-1].'star">';
}
else {$rate_off .='">';}
for ($r = 1; $r <= 5; $r++ ) {
$rate_off .= '<li class="'.$stars[($r-1)].'"><a href="#torrent" title="'.$lang['RATING_'.$r].'"></a></li>' ;
}
$rate_off .='</ul>';
PHP:
//Thanks mod
'RATING' => '<span id="VR'.$attach_id.'" style="float:left;">'. (($userdata['user_id'] == ANONYMOUS || $your_vote > 0) ? $rate_off : $rate_on) .'</span>',
'RATING_VOTES' => '<span id="VC'.$attach_id.'">'. $rating_count .'</span>',
'THANKED' => '<span id="VT'.$attach_id.'">'. $thanks .'</span>'
. ($thanked || ($userdata['user_id'] == $poster_id) ? '' : '<span id="VB'.$attach_id.'">'. ' <img src="images/sps.gif" onClick="say_thank(\'thank\',' . $attach_id.');" alt="'. $lang['THANKS'] .'" style="cursor:pointer" /></span>')
. ($thanks > 0 ? ' (<span id="VL'.$attach_id.'"><a href="#torrent" onClick="say_thank(\'list\','.$attach_id.');">'. $lang['THANK_LIST'] .'</a></span>)' : ''),
'YOUR_VOTE' => '<span id="VD'.$attach_id.'" style="margin-left:5px;">' . ($your_vote > 0 ? $lang['YOUR_VOTE'].': '.$lang['RATING_'.$your_vote]:'') . '</span>',
//Thanks mod End
PHP:
<tr class="row1">
<td class="genmed">{L_RATING}: </td>
<td class="genmed">{postrow.attach.tor_reged.RATING}<div class="voted" >({L_RATING_VOTES}: {postrow.attach.tor_reged.RATING_VOTES})<!-- IF postrow.attach.tor_reged.YOUR_VOTE -->{postrow.attach.tor_reged.YOUR_VOTE}<!-- ENDIF --></div>
</td>
</tr>
<tr class="row1">
<script language="JavaScript" type="text/javascript" src="./misc/js/ajax.js"></script>
<link rel="stylesheet" href="./misc/css/rating.css" type="text/css" />
<td>{L_THANKED}:</td>
<td>{postrow.attach.tor_reged.THANKED}</td>
</tr>
Код:
/* the default rating is placed as a background image in the ul */
/* use the background position according to the table above to display the required images*/
.rating{
width:80px;
height:16px;
margin:0 !important;
padding:0;
list-style:none;
clear:both;
position:relative;
background: url(star-matrix.gif) no-repeat 0 0;
}
/* add these classes to the ul to effect the change to the correct number of stars */
.nostar {background-position:0 0}
.onestar {background-position:0 -16px}
.twostar {background-position:0 -32px}
.threestar {background-position:0 -48px}
.fourstar {background-position:0 -64px}
.fivestar {background-position:0 -80px}
ul.rating li {
cursor: pointer;
/*ie5 mac doesn't like it if the list is floated\*/
float:left;
/* end hide*/
text-indent:-999em;
}
ul.rating li a {
position:absolute;
left:0;
top:0;
width:16px;
height:16px;
text-decoration:none;
z-index: 200;
}
ul.rating li.one a {left:0}
ul.rating li.two a {left:16px;}
ul.rating li.three a {left:32px;}
ul.rating li.four a {left:48px;}
ul.rating li.five a {left:64px;}
ul.rating li a:hover {
z-index:2;
width:80px;
height:16px;
overflow:hidden;
left:0;
background: url(star-matrix.gif) no-repeat 0 0;
}
ul.rating li.one a:hover {background-position:0 -96px;}
ul.rating li.two a:hover {background-position:0 -112px;}
ul.rating li.three a:hover {background-position:0 -128px}
ul.rating li.four a:hover {background-position:0 -144px}
ul.rating li.five a:hover {background-position:0 -160px}
/* end rating code */
.voted {
float:left;
margin:0 5px;
line-height:16px;
}