SQL:
Code
ALTER TABLE torrents ADD silverload ENUM ('yes','no') DEFAULT 'no';
announse.php
найти:
Code
$res = mysql_query("SELECT id, banned,free,seeders + leechers AS....
добавить в запрос
Заменяем это
Code
if ($upthis > 0 || $downthis > 0)
mysql_query("UPDATE users SET uploaded = uploaded + $upthis". ($torrent['free']=='no'?", downloaded = downloaded + $downthis ":' '). "WHERE id=$userid") or err("Tracker error 3");
на это
Code
if ($upthis > 0 || $downthis > 0) {
if ($torrent["silverload"] == 'yes') {
$xxXxxDown = $downthis / 2; // Если торрент Серебренный,то делет скачаное на 2.
$xxXxxUpload = $upthis; // Остваляет
}elseif($torrent["free"] =='yes'){
$xxXxxDown = 0; // Если торрент Золотой,то сумма скачаного равна нулю.
$xxXxxUpload = $upthis; // Остваляет
}else{
$xxXxxDown = $downthis; // Если обычная раздача,то обычно.
$xxXxxUpload = $upthis; // Если обычная раздача,то обычно.
}
mysql_query("UPDATE users SET uploaded = uploaded + $xxXxxUpload, downloaded = downloaded + $xxXxxDown WHERE id=$userid") or err("Tracker error 4");
}
edit.php
найти
Code
if(get_user_class()>=UC_MODERATOR)
{
tr("<div align=left><b>Видим:</b></div>", "<input type=\"checkbox\" name=\"visible\"" . (($row["visible"] == "yes") ? " checked=\"checked\"" : "" ) . " value=\"1\" /> Видим на главной<br /><table border=0 cellspacing=0 cellpadding=0 width=420><tr><td class=embedded></td></tr></table>", 1);
}
после добавить
Code
if(get_user_class()>=UC_MODERATOR)
{
tr("<div align=left><b>Серебряная раздача:</b></div>", "<input type='checkbox' name='silverload'" . (($row["silverload"] == "yes") ? " checked='checked'" : "" ) . " value='1' />Зделать раздачу cеребряной. (Учитывается толко <b>50%</b>скачанного от общего размера файла)", 1);
}
takeedit.php
найти
Code
$updateset[] = "forcevisible = '" . ($_POST["forcevisible"] ? "yes" : "no") . "'";
после добавить
Code
if(get_user_class()>=UC_MODERATOR)
$updateset[] = "silverload = '".($_POST["silverload"]==1 ? 'yes' : 'no')."'";
browse.php
найти
Code
elseif ($_GET["incldead"] == 3)
{
$addparam .= "incldead=3&";
$wherea[] = "free = 'yes'";
$wherea[] = "visible = 'yes'";
}
else
$wherea[] = "visible = 'yes'";
после добавить
Code
if($_GET["incldead"] == 4)
{
$addparam .= "incldead=4&";
$wherea[] = "silverload = 'yes'";
$wherea[] = "visible = 'yes'";
}
найти запрос
Code
$query = "SELECT torrents.id, torrents.category,users.class,.....
добавить к нему
далее ниже добавёяем в форму поиска
Code
<option value="4"<?php print($_GET["incldead"] == 4 ? " selected" : "");?>>Серебряные</option>
Открываем function.php
Ближе к концу файла находим:
Code
$thisisfree = ($row[free]=="yes" ? "<img src=\"pic/freedownload.gif\" title=\"".$tracker_lang['golden']."\" alt=\"".$tracker_lang['golden']."\">" : "");
После вставляем:
Code
$thissilverload = ($row[silverload]=="yes" ? "<img src='pic/silverdownload.gif' />" : "");
Немного ниже находим:
Code
print("\"><b>$dispname</b></a> $thisisfree\n");
Заменяем на:
Code
print("\"><b>$dispname</b></a> $thisisfree $thissilverload\n");