Другой вариант под СЕО - Открыть:
posting.php
Найти:
- Код: выделить все
if ($mode == 'edit')
{
$data['topic_replies_real'] = $post_data['topic_replies_real'];
$data['topic_replies'] = $post_data['topic_replies'];
}
Добавить после:
- Код: выделить все
// idiotnesia wuz here
if ($mode == 'reply')
{
$data['topic_replies_real'] = $post_data['topic_replies_real'];
}
Открыть:
includes/functions_posting.php
Найти
- Код: выделить все
// Send Notifications
Добавить перед:
- Код: выделить все
// idiotnesia wuz here -------------------------------------------------------
$newURL = '1';
if ($mode == 'reply' && $data['topic_replies_real'] >= 249)
{
$db->sql_query('UPDATE ' . TOPICS_TABLE . ' SET topic_status = ' . ITEM_LOCKED . ' WHERE topic_id = ' . (int) $data['topic_id'] . ' AND topic_moved_id = 0');
$data['message'] = generate_text_for_edit($data['message'], $data['bbcode_uid'], true);
$data['message'] = htmlspecialchars(html_entity_decode($data['message']['text']));
// variables to hold the parameters for submit_post
$poll = $uid = $bitfield = $options = '';
$allow_bbcode = $data['enable_bbcode'];
$allow_urls = $data['enable_urls'];
$allow_smilies = $data['enable_smilies'];
//Create next topic
$next_topic_text = '[url=' . generate_board_url() . '/viewtopic.' . $phpEx . '?f=' . $data['forum_id'] . '&t=' . $data['topic_id'] . ']' . $user->lang['PREVIOUS_TOPIC'] . '[/url]<br />' . $data['message'];
//If old post has attachments
$sql = 'SELECT attach_id, mimetype FROM ' . ATTACHMENTS_TABLE . ' WHERE post_msg_id = ' . (int) $data['post_id'];
$result = $db->sql_query($sql);
while ($attach_row = $db->sql_fetchrow($result))
{
if(strpos($attach_row['mimetype'], 'image/') !== false)
{
$next_topic_text .= '<br />[img]' . generate_board_url() . '/download/file.php?id= ' . (int) $attach_row['attach_id'] . '[/img]';
}
else
{
$next_topic_text .= '<br />[url=' . generate_board_url() . '/download/file.php?id= ' . (int) $attach_row['attach_id'] . ']' . $user->lang['DOWNLOAD_FILE'] . '[/url]';
}
}
$db->sql_freeresult($result);
$next_topic_text = preg_replace('/[attachment=(.*?)[/attachment]/', '', $next_topic_text);
generate_text_for_storage($next_topic_text, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);
$next_topic_data = array(
'forum_id' => $data['forum_id'],
'icon_id' => $data['icon_id'],
'topic_title' => $subject,
'enable_bbcode' => $data['enable_bbcode'],
'enable_smilies' => $data['enable_smilies'],
'enable_urls' => $data['enable_urls'],
'enable_sig' => $data['enable_sig'],
'message' => $next_topic_text,
'message_md5' => (string)md5($next_topic_text),
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'post_edit_locked' => $data['post_edit_locked'],
'notify_set' => $data['notify_set'],
'notify' => $data['notify'],
'post_time' => $current_time,
'forum_name' => $data['forum_name'],
'enable_indexing' => $data['enable_indexing'],
'post_expire_time' => -1,
'topic_expire_type' => 0,
'expire_forum_id' => 0,
'forum_ranon_flags' => 0,
'topic_featured' => 0,
'post_id' => 0,
);
$newURL = submit_post('post', $subject, '', POST_NORMAL, $poll, $next_topic_data);
//Edit old topic
$this_topic_text = $data['message'] . '<br />[url=' . generate_board_url() . '/viewtopic.' . $phpEx . '?f=' . $data['forum_id'] . '&t=' . $next_topic_data['topic_id'] . ']' . $user->lang['NEXT_TOPIC'] . '[/url]';
generate_text_for_storage($this_topic_text, $uid, $bitfield, $options, true, true, true);
$this_topic_data = array(
'forum_id' => (int) $data['forum_id'],
'poster_id' => (int) $data['poster_id'],
'icon_id' => (int) $data['icon_id'],
'post_approved' => (isset($data['post_approved'])) ? $data['post_approved'] : false,
'enable_bbcode' => (bool) $data['enable_bbcode'],
'enable_smilies' => (bool) $data['enable_smilies'],
'enable_urls' => (bool) $data['enable_urls'],
'enable_sig' => (bool) $data['enable_sig'],
'topic_title' => $subject,
'message_md5' => (string)md5($this_topic_text),
'attachment_data' => $data['attachment_data'],
'bbcode_bitfield' => $bitfield,
'bbcode_uid' => $uid,
'post_edit_locked' => (int) $data['post_edit_locked'],
'message' => $this_topic_text,
'topic_approved' => (isset($data['topic_approved'])) ? $data['topic_approved'] : false,
'topic_first_post_id' => (isset($data['topic_first_post_id'])) ? (int) $data['topic_first_post_id'] : 0,
'topic_last_post_id' => (isset($data['topic_last_post_id'])) ? (int) $data['topic_last_post_id'] : 0,
'topic_time_limit' => (int) $data['topic_time_limit'],
'post_id' => (int) $data['post_id'],
'topic_id' => (int) $data['topic_id'],
'topic_replies_real' => $data['topic_replies_real'],
'enable_indexing' => (bool) $data['enable_indexing'],
'post_time' => (isset($data['post_time'])) ? (int) $data['post_time'] : $current_time,
'post_edit_reason' => $data['post_edit_reason'],
'post_edit_user' => 0,
'forum_name' => $data['forum_name'],
'notify' => (isset($data['notify'])) ? $data['notify'] : false,
'notify_set' => (isset($data['notify_set'])) ? $data['notify_set'] : false,
'post_expire_time' => -1,
'topic_expire_type' => 0,
'expire_forum_id' => 0,
'forum_ranon_flags' => 0,
'topic_featured' => 0,
);
submit_post('edit', $subject, '', POST_NORMAL, $poll, $this_topic_data);
}
// idiotnesia wuz here ------------------------------------------------------
Найти:
- Код: выделить все
$url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx";
if (isset($data['post_moved_link']))
{
$url = ( $data['post_moved_link'] )? $data['post_id'] : append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor;
}
else
{
$url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor; //Добавлено FEAR93
}
Добавить до:
- Код: выделить все
if($newURL == '1'){
Добавить после:
- Код: выделить все
}
else
{
$url = (isset($data['post_moved_link']) && $data['post_moved_link']) ? $data['post_id'] : $newURL;
}
Порядок!!!!
Ещё вот такие правки можно, под
Fotovideoforum.ru
includes/functions_posting.php
Найти
- Код: выделить все
$next_topic_text = '[url=' . generate_board_url() . '/viewtopic.' . $phpEx . '?f=' . $data['forum_id'] . '&t=' . $data['topic_id'] . ']' . $user->lang['PREVIOUS_TOPIC'] . '[/url]<br />' . $data['message'];
Заменить на (заменяю ссылку на тему для seo)
- Код: выделить все
$next_topic_text = '[url=' . generate_board_url() . '/topic' . $data['topic_id'] . '.html]' . $user->lang['PREVIOUS_TOPIC'] . '[/url]<br />' . $data['message'];
Найти
- Код: выделить все
$next_topic_text .= '<br />[img]' . generate_board_url() . '/download/file.php?id= ' . (int) $attach_row['attach_id'] . '[/img]';
Заменить на (
img на hsimg
)
- Код: выделить все
$next_topic_text .= '<br />[hsimg]' . generate_board_url() . '/download/file.php?id= ' . (int) $attach_row['attach_id'] . '[/hsimg]';
Найти
- Код: выделить все
$this_topic_text = $data['message'] . '<br />[url=' . generate_board_url() . '/viewtopic.' . $phpEx . '?f=' . $data['forum_id'] . '&t=' . $next_topic_data['topic_id'] . ']' . $user->lang['NEXT_TOPIC'] . '[/url]';
Заменить на (тоже seo-ссылки)
- Код: выделить все
$this_topic_text = $data['message'] . '<br />[url=' . generate_board_url() . '/topic' . $next_topic_data['topic_id']. '.html]' . $user->lang['NEXT_TOPIC'] . '[/url]';
Остаются ссылки на вложения, но тут они не так просто замещаются