Всё для Веб-Мастера » Всё для TBDev » TBDev-Хаки » Проверено модератором!
Правила Контакты Чтение RSS

Проверено модератором!

Проверено модератором!


В базе удаляем поля "moderated" и "moderatedby" в таблице "torrents"

добавляем в базу

ALTER TABLE `torrents` ADD `moderated` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `torrents` ADD `moderatedby` int(10) unsigned default '0';
ALTER TABLE `torrents` ADD `moderatorname` varchar(40) NOT NULL default '';



в details.php находим

PHP код:
$res = sql_query("SELECT torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, LENGTH(torrents.nfo) AS nfosz, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(torrents.last_action) AS lastseed, torrents.numratings, torrents.name, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, torrents.image1, torrents.image2, categories.name AS cat_name, users.username, groups.image FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN users ON torrents.owner = users.id LEFT JOIN groups ON users.groups = groups.id WHERE torrents.id = $id")
        or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_array($res);



заменяем на

$res = sql_query("SELECT torrents.seeders, torrents.moderated, torrents.moderatedby, torrents.moderatorname, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, LENGTH(torrents.nfo) AS nfosz, UNIX_TIMESTAMP() - UNIX_TIMESTAMP(torrents.last_action) AS lastseed, torrents.numratings, torrents.name, IF(torrents.numratings < $minvotes, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.numfiles, torrents.image1, torrents.image2, categories.name AS cat_name, users.username, groups.image FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN users ON torrents.owner = users.id LEFT JOIN groups ON users.groups = groups.id WHERE torrents.id = $id")
or sqlerr(__FILE__, __LINE__);
$row = mysql_fetch_array($res);



находим

$editlink = "a href=\"$url\" class=\"sublink\"";

                $s = "<a class=\"index\" href=\"download.php?id=$id&amp;name=" . rawurlencode($row["filename"]) . "\"><b>" . $row["name"] . "</b></a>";
                if ($owned)
                $s .= " $spacer<$editlink>[".$tracker_lang['edit']."]</a>";

                tr ("<nobr>{$row["cat_name"]}</nobr>", $s, 1, 1, "10%");

                function hex_esc($matches) {
                        return sprintf("%02x", ord($matches[0]));
                }



после вставляем

if (get_user_class() >= UC_MODERATOR) {
                print("<tr><td class=rowhead2>Проверен</td>");

            if ($row["moderated"] == "no")

            {if ($CURUSER["id"] == $row["owner"])
            print("<td align=\"left\"><b>это твой торрент</b></td>\n");

            else

            print("<td align=\"left\"><a href=check.php?id=$id><b>Нет</b></a></td>\n");}

            else
                print("<td align=\"left\"><a href=\"userdetails.php?id=$row[moderatedby]\"><b>$row[moderatorname]</b></a></td></tr>\n");

        }



создаем файлик check.php

<?

require_once("include/bittorrent.php");

if (!mkglobal("id"))
    die();

$id = 0 + $id;
if (!$id)
    die();

dbconn();

loggedinorreturn();

$updateset = array();

if(get_user_class() >= UC_MODERATOR)

$updateset[] = "moderated = 'yes'";
$updateset[] = "moderatedby = ".sqlesc($CURUSER["id"]);
$updateset[] = "moderatorname = ".sqlesc($CURUSER["username"]);

mysql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id");


$returl = "details.php?id=$id";
if (isset($_POST["returnto"]))
    $returl .= "&returnto=" . urlencode($_POST["returnto"]);
header("Refresh: 0; url=$returl");
?>



и еще..из takeedit.php удалить

$updateset[] = "moderated = 'yes'";
$updateset[] = "moderatedby = ".sqlesc($CURUSER["id"]);



Скачать бесплатно Проверено модератором! на WebWel.ru

Информация
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.

Навигация ! ! !

Designed by EnerGY