Надеюсь, описание понятное
Мод в стартовой стадии разработки.
Код: Выделить всё
Author: rxu <http://phpbbguru.net>
OPEN
viewonline.php
FIND
$prev_id = $prev_ip = $user_list = array();
BEFORE, ADD
$topics_ids = $posts_ids = $posts_topics_ids = $topic_title = array();
while ($row = $db->sql_fetchrow($result))
{
preg_match('#t=([0-9]+)#i', $row['session_page'], $topic_id);
$topic_id = (sizeof($topic_id)) ? (int) $topic_id[1] : 0;
if($topic_id)
{
$topics_ids[] = $topic_id;
}
preg_match('#p=([0-9]+)#i', $row['session_page'], $post_id);
$post_id = (sizeof($post_id)) ? (int) $post_id[1] : 0;
if($post_id)
{
$posts_ids[] = $post_id;
}
}
$db->sql_rowseek(0, $result);
if (sizeof($posts_ids))
{
$sql = 'SELECT post_id, topic_id FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('post_id', $posts_ids);
$posts_result = $db->sql_query($sql);
while ($posts = $db->sql_fetchrow($posts_result))
{
$topics_ids[] = $posts['topic_id'];
$posts_topics_ids[$posts['post_id']] = $posts['topic_id'];
}
$db->sql_freeresult($posts_result);
}
if (sizeof($topics_ids))
{
$topics_ids = array_unique($topics_ids);
$sql = 'SELECT topic_id, topic_title FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $topics_ids);
$topics_result = $db->sql_query($sql);
while ($topics = $db->sql_fetchrow($topics_result))
{
$topic_title[$topics['topic_id']] = $topics['topic_title'];
}
$db->sql_freeresult($topics_result);
}
FIND
$location = sprintf($user->lang['READING_TOPIC'], $forum_data[$forum_id]['forum_name']);
REPLACE WITH
preg_match('#t=([0-9]+)#i', $row['session_page'], $topic_id);
$topic_id = (sizeof($topic_id)) ? (int) $topic_id[1] : 0;
preg_match('#p=([0-9]+)#i', $row['session_page'], $post_id);
$post_id = (sizeof($post_id)) ? (int) $post_id[1] : 0;
$location = ($topic_id && !$post_id) ? sprintf($user->lang['READING_THE_TOPIC'], $topic_title[$topic_id], $forum_data[$forum_id]['forum_name']) : (($post_id) ? sprintf($user->lang['READING_THE_POST'], $topic_title[$posts_topics_ids[$post_id]], $forum_data[$forum_id]['forum_name']) : sprintf($user->lang['READING_TOPIC'], $forum_data[$forum_id]['forum_name']));
$location_url = ($topic_id && !$post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&t=' . $topic_id) : (($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=$post_id#p$post_id") : $location_url);
OPEN
language/en/common.php
FIND
'READING_TOPIC'
AFTER, ADD
'READING_THE_TOPIC' => 'Reading the topic <strong>%1$s</strong> in %2$s',
'READING_THE_POST' => 'Reading the post in the topic <strong>%1$s</strong> in %2$s',