- Совместимость
- не проверялся на совместимость
- Изменения в БД
- требуются
- Автор
- _Xz_
- Общественное достояние
- да
Описание: добавляет возможность автоматически парсить раздачи с nnm-club, используя несколько аккаунтов.
- Инструкция по установке
-
PHP:
-- -------------------------------------------------------- INSERT INTO `bb_config` ( `config_name` , `config_value` ) VALUES ( 'nnmclub_login', '' ), ( 'nnmclub_pass', '' ); CREATE TABLE IF NOT EXISTS `nnmclub_forums` ( `active` tinyint(1) NOT NULL DEFAULT '1', `forum_old` varchar(255) NOT NULL, `forum_new` int(11) NOT NULL, `user_id` int(11) NOT NULL DEFAULT '0', `all_forum` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `nnmclub_releases` ( `id` int(11) NOT NULL, `attach_id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `forum_old` varchar(255) NOT NULL, `time` varchar(11) NOT NULL DEFAULT '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8; открыть ajax.php найти/заменить 'manage_user' => array('admin'), 'nnmclub' => array('admin'), перед последней скобкой добавить function nnmclub () { global $lang, $bb_cfg; require(INC_DIR .'class.snoopy.php'); $mode = (string) $this->request['mode']; if(!empty($this->request['full'])) { $full = 'full_'; } else $full = ''; if($mode == 'forum_del') { $forum_old = (string) urldecode($this->request['forum_old']); DB()->query("DELETE FROM {$full}nnmclub_forums WHERE forum_old = '$forum_old'"); } elseif($mode == 'change_user_id') { $new_user = (string) $this->request['user']; $url = (string) $this->request['url']; if(!$url || !$new_user) bb_die('false id'); if(($new_user != BOT_UID) && !$new = get_userdata($new_user)) bb_die($lang['NO_USER_ID_SPECIFIED']); if($new) $new_user = $new['user_id']; DB()->query("UPDATE {$full}nnmclub_forums SET user_id = $new_user WHERE forum_old = '$url'"); $this->response['user'] = ($new) ? profile_url($new) : 'Bot'; $this->response['url'] = md5($url); $this->response['mode'] = $mode; } elseif($mode == 'all_forum') { $forum_old = (string) urldecode($this->request['forum_old']); if(!$forum_old) bb_die('false id'); $row = DB()->fetch_row("SELECT * FROM {$full}nnmclub_forums WHERE forum_old = '$forum_old' LIMIT 1"); if(!$row) bb_die('Такой записи нет в базе'); $all_forum = (int) !$row['all_forum']; DB()->query("UPDATE {$full}nnmclub_forums SET all_forum = $all_forum WHERE forum_old = '$forum_old'"); } elseif($mode == 'active') { $forum_old = (string) urldecode($this->request['forum_old']); if(!$forum_old) bb_die('false id'); $row = DB()->fetch_row("SELECT * FROM {$full}nnmclub_forums WHERE forum_old = '$forum_old' LIMIT 1"); if(!$row) bb_die('Такой записи нет в базе'); $active = (int) !$row['active']; DB()->query("UPDATE {$full}nnmclub_forums SET active = $active WHERE forum_old = '$forum_old'"); } }