mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
feat: Prevent robots indexing for private topics (#2071)
This commit is contained in:
parent
3eba11f26b
commit
eecfe1a951
2 changed files with 13 additions and 5 deletions
|
@ -253,7 +253,11 @@ if (!empty($bb_cfg['tor_cannot_edit']) && $post_info['allow_reg_tracker'] && $po
|
||||||
$robots_indexing = $post_info['topic_allow_robots'] ?? true;
|
$robots_indexing = $post_info['topic_allow_robots'] ?? true;
|
||||||
if ($submit || $refresh) {
|
if ($submit || $refresh) {
|
||||||
if (IS_AM) {
|
if (IS_AM) {
|
||||||
$robots_indexing = !empty($_POST['robots']);
|
if ($post_info['auth_read'] == AUTH_ALL) {
|
||||||
|
$robots_indexing = !empty($_POST['robots']);
|
||||||
|
} else {
|
||||||
|
$robots_indexing = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$notify_user = (int)!empty($_POST['notify']);
|
$notify_user = (int)!empty($_POST['notify']);
|
||||||
} else {
|
} else {
|
||||||
|
@ -504,7 +508,7 @@ if (!IS_GUEST) {
|
||||||
$topic_type_toggle = '';
|
$topic_type_toggle = '';
|
||||||
if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) {
|
if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) {
|
||||||
// Allow robots indexing
|
// Allow robots indexing
|
||||||
if (IS_AM) {
|
if (IS_AM && $post_info['auth_read'] == AUTH_ALL) {
|
||||||
$template->assign_var('SHOW_ROBOTS_CHECKBOX');
|
$template->assign_var('SHOW_ROBOTS_CHECKBOX');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,9 +113,6 @@ $topic_id = $t_data['topic_id'];
|
||||||
$forum_id = $t_data['forum_id'];
|
$forum_id = $t_data['forum_id'];
|
||||||
$topic_attachment = isset($t_data['topic_attachment']) ? (int)$t_data['topic_attachment'] : null;
|
$topic_attachment = isset($t_data['topic_attachment']) ? (int)$t_data['topic_attachment'] : null;
|
||||||
|
|
||||||
// Allow robots indexing
|
|
||||||
$page_cfg['allow_robots'] = (bool)$t_data['topic_allow_robots'];
|
|
||||||
|
|
||||||
if ($t_data['allow_porno_topic'] && bf($userdata['user_opt'], 'user_opt', 'user_porn_forums')) {
|
if ($t_data['allow_porno_topic'] && bf($userdata['user_opt'], 'user_opt', 'user_porn_forums')) {
|
||||||
bb_die($lang['ERROR_PORNO_FORUM']);
|
bb_die($lang['ERROR_PORNO_FORUM']);
|
||||||
}
|
}
|
||||||
|
@ -229,6 +226,13 @@ $datastore->rm('cat_forums');
|
||||||
// Make jumpbox
|
// Make jumpbox
|
||||||
make_jumpbox();
|
make_jumpbox();
|
||||||
|
|
||||||
|
// Allow robots indexing
|
||||||
|
if ($is_auth['auth_read']) {
|
||||||
|
$page_cfg['allow_robots'] = (bool)$t_data['topic_allow_robots'];
|
||||||
|
} else {
|
||||||
|
$page_cfg['allow_robots'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($post_id && !empty($t_data['prev_posts'])) {
|
if ($post_id && !empty($t_data['prev_posts'])) {
|
||||||
$start = floor(($t_data['prev_posts'] - 1) / $posts_per_page) * $posts_per_page;
|
$start = floor(($t_data['prev_posts'] - 1) / $posts_per_page) * $posts_per_page;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue