diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php index cec86dcf2..886e21fbf 100644 --- a/upload/includes/init_bb.php +++ b/upload/includes/init_bb.php @@ -314,6 +314,8 @@ $bb_cfg['tor_cannot_edit'] = array( TOR_CONSUMED => true, TOR_DUP => true, ); +// Запрет на создание новых раздач если стоит статус недооформлено/неоформлено/сомнительно +$bb_cfg['tor_cannot_new'] = array(TOR_NEED_EDIT, TOR_NO_DESC, TOR_DOUBTFUL); // Table names define('BUF_TOPIC_VIEW', 'buf_topic_view'); diff --git a/upload/includes/ucp/usercp_viewprofile.php b/upload/includes/ucp/usercp_viewprofile.php index 3c94c8857..e06679354 100644 --- a/upload/includes/ucp/usercp_viewprofile.php +++ b/upload/includes/ucp/usercp_viewprofile.php @@ -17,7 +17,7 @@ if (!$profiledata = get_userdata($_GET[POST_USERS_URL])) bb_die($lang['NO_USER_ID_SPECIFIED']); } -if(bf($profiledata['user_opt'], 'user_opt', 'view_profile')) +if(bf($profiledata['user_opt'], 'user_opt', 'view_profile') && IS_GUEST) { meta_refresh(append_sid("login.php?redirect={$_SERVER['REQUEST_URI']}", true)); bb_die("Пользователь {$profiledata['username']} запретил гостям просмотр своего профиля"); } diff --git a/upload/posting.php b/upload/posting.php index 8e7b0dd7e..fb09d9a38 100644 --- a/upload/posting.php +++ b/upload/posting.php @@ -291,6 +291,23 @@ if (!$is_auth[$is_auth_type]) if ($mode == 'newtopic' && $topic_tpl && $post_info['topic_tpl_id']) { + if($tor_status = join(',', $bb_cfg['tor_cannot_new'])) + { + $sql = DB()->fetch_rowset("SELECT t.topic_title, t.topic_id, tor.tor_status + FROM ". BB_BT_TORRENTS ." tor, ". BB_TOPICS ." t + WHERE poster_id = {$userdata['user_id']} + AND tor.topic_id = t.topic_id + AND tor.tor_status IN ($tor_status) + ORDER BY tor.reg_time + "); + + $topics = ''; + foreach($sql as $row) + { + $topics .= $bb_cfg['tor_icons'][$row['tor_status']] .''. $row['topic_title'] .'
'; + } + if ($topics) bb_die($topics .'У вас есть неоформленный релиз, прежде чем создавать новый исправьте свой неоформленный.'); + } require(INC_DIR .'topic_templates.php'); } @@ -802,9 +819,9 @@ $template->assign_vars(array( 'CAPTCHA_HTML' => (IS_GUEST) ? CAPTCHA()->get_html() : '', 'SUBJECT' => $subject, 'MESSAGE' => $message, - + 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? append_sid("viewtopic.php?" . POST_TOPIC_URL . "=$topic_id&postorder=desc") : '', - + 'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '', 'S_TYPE_TOGGLE' => $topic_type_toggle, 'S_TOPIC_ID' => $topic_id,