Дополнение к модулю Tracker for DLE, для вывода списка непроверенных раздач.
1. Файл: /engine/engine.phpНайти:
// ################ Вывод отдельной категории #################
if ($do == "cat" and $category != '' and $subaction == '') {
Добавить выше:
#****** Tracker for DLE *** Uncheck *** start ******#
if($category == "torrent_uncheck") $do = "torrent_uncheck";
#****** Tracker for DLE *** Uncheck *** stop ******#
Найти:
} elseif ($do == 'tags') {
// ################ Поиск новостей по тегу #################
Добавить выше:
#****** Tracker for DLE *** Uncheck *** start ******#
} elseif ($do == 'torrent_uncheck') {
if($user_group[$member_id['user_group']]['allow_all_edit']) {
if ($cstart) {
$cstart = $cstart - 1;
$cstart = $cstart * $config['news_number'];
}
$newsmodule = true;
$sql_select = "SELECT p.id, p.autor, p.date, p.short_story, SUBSTRING(p.full_story, 1, 15) as full_story, p.xfields, p.title, p.category, p.alt_name, p.comm_num, p.allow_comm, p.allow_rate, p.rating, p.vote_num, p.news_read, p.votes, p.approve, p.flag, p.editdate, p.editor, p.reason, p.view_edit, p.tags FROM " . PREFIX . "_post p LEFT JOIN " . PREFIX . "_files f ON (f.news_id=p.id) WHERE f.check=0 AND f.size>0 AND f.news_id>0 ORDER BY p.date DESC LIMIT " . $cstart . "," . $config['news_number'];
$sql_count = "SELECT COUNT(*) as count FROM " . PREFIX . "_post p LEFT JOIN " . PREFIX . "_files f ON (f.news_id=p.id) WHERE f.check=0 AND f.size>0 AND f.news_id>0";
$config['allow_cache'] = false;
} else {
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$config['http_home_url']}");
die("Redirect");
}
#****** Tracker for DLE *** Uncheck *** stop ******#
#****** Tracker for DLE *** Uncheck *** start ******#
} elseif ($do == 'torrent_uncheck') {
if($user_group[$member_id['user_group']]['allow_all_edit']) {
if ($cstart) {
$cstart = $cstart - 1;
$cstart = $cstart * $config['news_number'];
}
$newsmodule = true;
$url_page = $config['http_home_url'] . "torrent_uncheck";
$user_query = "do=torrent_uncheck";
$sql_select = "SELECT p.id, p.autor, p.date, p.short_story, SUBSTRING(p.full_story, 1, 15) as full_story, p.xfields, p.title, p.category, p.alt_name, p.comm_num, p.allow_comm, p.fixed, p.tags, e.news_read, e.allow_rate, e.rating, e.vote_num, e.votes, e.view_edit, e.editdate, e.editor, e.reason FROM " . PREFIX . "_post p LEFT JOIN " . PREFIX . "_post_extras e ON (p.id=e.news_id) LEFT JOIN " . PREFIX . "_files f ON (f.news_id=p.id) WHERE f.check=0 AND f.size>0 AND f.news_id>0 ORDER BY date DESC LIMIT " . $cstart . "," . $config['news_number'];
$sql_count = "SELECT COUNT(p.id) as count FROM " . PREFIX . "_post p LEFT JOIN " . PREFIX . "_files f ON (f.news_id=p.id) WHERE f.check=0 AND f.size>0 AND f.news_id>0";
} else {
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$config['http_home_url']}");
die("Redirect");
}
$config['allow_cache'] = false;
#****** Tracker for DLE *** Uncheck *** stop ******#
#****** Tracker for DLE *** Uncheck *** start ******#
} elseif ($do == 'torrent_uncheck') {
if($user_group[$member_id['user_group']]['allow_all_edit']) {
if ($cstart) {
$cstart = $cstart - 1;
$cstart = $cstart * $config['news_number'];
}
$newsmodule = true;
$url_page = $config['http_home_url'] . "torrent_uncheck";
$user_query = "do=torrent_uncheck";
$sql_select = "SELECT p.id, p.autor, p.date, p.short_story, CHAR_LENGTH(p.full_story) as full_story, p.xfields, p.title, p.category, p.alt_name, p.comm_num, p.allow_comm, p.fixed, p.tags, e.news_read, e.allow_rate, e.rating, e.vote_num, e.votes, e.view_edit, e.editdate, e.editor, e.reason FROM " . PREFIX . "_post p LEFT JOIN " . PREFIX . "_post_extras e ON (p.id=e.news_id) LEFT JOIN " . PREFIX . "_files f ON (f.news_id=p.id) WHERE f.check=0 AND f.size>0 AND f.news_id>0 ORDER BY date DESC LIMIT " . $cstart . "," . $config['news_number'];
$sql_count = "SELECT COUNT(p.id) as count FROM " . PREFIX . "_post p LEFT JOIN " . PREFIX . "_files f ON (f.news_id=p.id) WHERE f.check=0 AND f.size>0 AND f.news_id>0";
$config['allow_cache'] = false;
} else {
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$config['http_home_url']}");
die("Redirect");
}
#****** Tracker for DLE *** Uncheck *** stop ******#
2. Файл: /engine/modules/show.full.phpНайти:
$member_id['user_group'] != '1'
Заменить на:
$user_group[$member_id['user_group']]['allow_all_edit'] != 1
3. Ссылка на страницу с непроверенными раздачами: /?do=torrent_uncheck
4. Если нужно открыть всем юзерам доступ к странице с не проверенными раздачами, то для этого надо просто в коде что выше вносит правки найти и удалить строки:
if($user_group[$member_id['user_group']]['allow_all_edit']) {
} else {
header("HTTP/1.0 301 Moved Permanently");
header("Location: {$config['http_home_url']}");
die("Redirect");
}
Уважаемый посетитель, Вы зашли на сайт как незарегистрированный пользователь.
Мы рекомендуем Вам
зарегистрироваться либо войти на сайт под своим именем.