Kód:
###############################################
## Hack Title: The topic user is viewing
## Hack Version: 0.9.9
## Author: DTTVB (a.k.a. Mechakoopa Revolution) <mechakoopa@gmail.com>
## Description: This hack will show what topic in what forum each user is viewing in Who is Online.
## Compatibility: 2.0.17
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
##
## Files To Edit: 3
## includes/sessions.php
## viewonline.php
## viewtopic.php
##
## Included Files: N/A
##
## History:
## N/A
##
## Support: http://www.phpbbhacks.com/forums
##
## Copyright: Copyright (C) 2005 The topic user is viewing 0.9.9 - DTTVB
###############################################
##
## Author Notes:
## There is an unused constant PAGE_TOPIC_OFFSET.
## So I use that constant to make this hack.
##
###############################################
## Always back up all files related to this hack before use!
###############################################
## You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads.
## Please visit http://www.phpbbhacks.com/forums for support.
###############################################
## Please visit http://www.phpbbhacks.com/ for updates of this hack.
###############################################
## This hack is released under the GPL License.
## This hack can be freely used, but not distributed, without permission.
###############################################
## You can always contact me via e-mail if you have any questions, suggestions.
## My e-mail is mechakoopa@gmail.com
###############################################
#
#-----[ OPEN ]---------------------------------------
#
viewonline.php
#
#-----[ FIND ]---------------------------------------
#
//
// Forum info
//
#
#-----[ AFTER, ADD ]---------------------------------
#
$topiq_dataz = array();
$sql = "SELECT topic_title, topic_id, forum_id
FROM " . TOPICS_TABLE;
if ( $result = $db->sql_query($sql) )
{
while( $row = $db->sql_fetchrow($result) )
{
$topiq_dataz[$row['topic_id']] = array($row['forum_id'],$row['topic_title']);
}
}
else
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}
#
#-----[ FIND ]---------------------------------------
#
else
{
$location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);
$location = $forum_data[$row['session_page']];
}
#
#-----[ AFTER, ADD ]---------------------------------
#
if ($row['session_page'] > PAGE_TOPIC_OFFSET) {
$location_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . ($row['session_page'] - PAGE_TOPIC_OFFSET));
$location = $topiq_dataz[$row['session_page'] - PAGE_TOPIC_OFFSET][1] . " (In " . $forum_data[$topiq_dataz[$row['session_page'] - PAGE_TOPIC_OFFSET][0]] . ")";
}
#
#-----[ OPEN ]---------------------------------------
#
viewtopic.php
#
#-----[ FIND ]---------------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id);
#
#-----[ REPLACE WITH ]---------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_TOPIC_OFFSET + $forum_topic_data['topic_id']);
#
#-----[ OPEN ]---------------------------------------
#
# Optional, this will make update session page immediately after click.
includes/sessions.php
#
#-----[ FIND ]---------------------------------------
#
if ( $current_time - $userdata['session_time'] > 60 )
#
#-----[ REPLACE WITH ]-------------------------------
#
if ( $current_time - $userdata['session_time'] > 0 )
#
#-----[ SAVE & CLOSE ALL FILES ]---------------------
#
# End of hack.