Постал на 15ый форум мод:
Код: Выделить всё
##############################################################
## MOD Title: Topic in Who is online
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. Rшd) http://mods.db9.dk
## MOD Description: This mod will make it possible to view
## exactly witch topic a user is looking
## at. The information is applyed in the
## Who-is-online list.
## MOD Version: 1.2.9
## MOD Compatibility: 2.0.6
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: 7
## viewonline.php
## viewtopic.php
## includes/page_header.php
## includes/sessions.php
## language/lang_english/lang_main.php
## template/subSilver/viewforum_body.tpl
## template/subSilver/viewtopic_body.tpl
##
## Included Files: 1
## topic_in_wio_db_update.php
##
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## 1. Full MOD description
## -----------
## This mod will make it possible to view exactly witch topic a
## user are looking at the information is applyed to the end of
## the forum information, in the Who-is-online list this mod
## also add a "who is also watching this topic list" like the
## already existing "Who is watching this forum".
##
## 2. EasyMOD
## -----------
## This MOD is compatible and can be installed by EasyMOD
## of Nuttzy (but is not officially EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## However, on alpha releases of EM and meanwhile beta or
## final release some actions are NOT performed.
## You'll have to do them manually !
##
## 2.1 SQL commands are not performed
## -----------
## This MOD need a database update.
## Then, in any case if you install this MOD manually or using
## an alpha release of EM, please copying the *_db_update.php
## in your phpBB root directory, run it with your navigator,
## and then delete it from the phpBB root directory.
##
## Please, do it NOW! Before editing phpBB files by EM or manually!!!
## Otherwise, you may have an error message during your next
## connection.
##
## 2.2 Translation are not managed
## -----------
## Moreover, EM can not already manage actions for any other
## language than English (but language intructions are proceed
## to all installed languages in order to prevent errors).
## So the translations provided with this MOD must be installed
## manually if you need them.
##
## 3. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://mods.db9.dk/viewtopic.php?t=42
##
##############################################################
## MOD History:
##
## 2003-12-23 - Version 1.2.9
## - phpBB template & EasyMOD compliance enhancement
## - Dutch, French, German, Hungarian, Italian, Lithuanian,
## & Spanish translations now provide
## with the MOD
##
## ????-??-?? - Version 1.2.8
## - now EM ready
##
## ????-??-?? - Version 1.2.7
## - changes made for phpBB2 2.0.5.
##
## ????-??-?? - Version 1.2.6
## - fixed that users inside a topic was not counted rigth
##
## ????-??-?? - Version 1.2.5
## - fixed a typo in the how-to page_header.php
##
## ????-??-?? - Version 1.2.4
## - fixed the count of users when viewing topic,
## called by post id
##
## ????-??-?? - Version 1.2.3
## - removed some "letovers" from the ver 2.0.0. how-to :-)
##
## ????-??-?? - Version 1.2.2
## - fixed a error that causes the link in who-is-online
## was wrong
##
## ????-??-?? - Version 1.2.1
## - fixed a error that causes "error, update sessions table"
##
## ????-??-?? - Version 1.2.0
## - re-write mod to comply with phpBB2 version 2.0.2.
##
## ????-??-?? - Version 1.0.4
## - now also display numbers of guest/hidden users
##
## ????-??-?? - Version 1.0.3
## - now also includes the "users browsing this topic list
##
## ????-??-?? - Version 1.0.2
## - missed to include the how-to for viewtopic.php
## - minor correction to session.php
##
## ????-??-?? - Version 1.0.1
## - improved refresh time
##
## ????-??-?? - Version 1.0.0
## - initial BETA release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------------
#
copy topic_in_wio_db_update.php to topic_in_wio_db_update.php
#
# This MOD need a database update.
# Then, as you must have now copied the topic_in_wio_db_update.php file
# in your phpBB root directory, run it with your navigator...
# http://www.yourWebSite.xxx/phpbbRootDir/topic_in_wio_db_update.php
#
# ...and then delete it from the phpBB root directory!!!
#
# Please, do it NOW! Before editing phpBB files by EM or manually!!!
# Otherwise, you may have an error message during your next
# connection.
#
#
#-----[ OPEN ]------------------------------------------------
#
viewonline.php
#
#-----[ FIND ]------------------------------------------------
#
$sql = "SELECT u.user_id, u.username
#
#-----[ IN-LINE FIND ]----------------------------------------
#
, s.session_page
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, s.session_topic
#
#-----[ FIND ]------------------------------------------------
#
$location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);
$location = $forum_data[$row['session_page']];
#
#-----[ REPLACE WITH ]----------------------------------------
#
// Start replacement - Topic in Who is online MOD
if ($row['session_topic'])
{
//
// Topic info
//
$sql = "SELECT topic_title FROM " . TOPICS_TABLE . " WHERE topic_id=" . $row['session_topic'];
if ( $result2 = $db->sql_query($sql) )
{
$topic_title = $db->sql_fetchrow($result2);
}
else
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}
$location_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $row['session_topic']);
$location = $forum_data[$row['session_page']] .' -> '.$topic_title['topic_title'];
} else
{
$location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']);
$location = $forum_data[$row['session_page']];
}
// End replacement - Topic in Who is online MOD
#
#-----[ OPEN ]------------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------------
#
$forum_id = intval($forum_topic_data['forum_id']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Topic in Who is online MOD
$topic_id = intval($forum_topic_data['topic_id']);
// End add - Topic in Who is online MOD
#
#-----[ FIND ]------------------------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id);
#
#-----[ IN-LINE FIND ]----------------------------------------
#
)
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $topic_id
#
#-----[ FIND ]------------------------------------------------
#
// Output page header
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Start add - Topic in Who is online MOD
define('SHOW_ONLINE', true);
// End add - Topic in Who is online MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------------
#
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
#
#-----[ REPLACE WITH ]----------------------------------------
#
// Start replacement - Topic in Who is online MOD
$user_forum_sql = ( !empty($topic_id) ) ? "AND s.session_topic = " . intval($topic_id) :(( !empty($forum_id) ) ? "AND s.session_page = ".intval($forum_id) : '');
// End replacement - Topic in Who is online MOD
#
#-----[ FIND ]------------------------------------------------
#
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . ' ' . $online_userlist;
#
#-----[ REPLACE WITH ]----------------------------------------
#
// Start replacement - Topic in Who is online MOD
$online_userlist = $lang['Registered_users'].' ' . $online_userlist;
// End replacement - Topic in Who is online MOD
#
#-----[ FIND ]------------------------------------------------
#
if ( $total_online_users == 0 )
{
$l_t_user_s = $lang['Online_users_zero_total'];
}
else if ( $total_online_users == 1 )
{
$l_t_user_s = $lang['Online_user_total'];
}
else
{
$l_t_user_s = $lang['Online_users_total'];
}
#
#-----[ REPLACE WITH ]----------------------------------------
#
// Start replacement - Topic in Who is online MOD
if ( $total_online_users == 0 )
{
$l_t_user_s = ( ( isset($topic_id) ) ? $lang['Browsing_topic'] : ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Online_users_zero_total'] ) );
}
else if ( $total_online_users == 1 )
{
$l_t_user_s = ( ( isset($topic_id) ) ? $lang['Browsing_topic'] : ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Online_user_total'] ) );
}
else
{
$l_t_user_s = ( ( isset($topic_id) ) ? $lang['Browsing_topic'] : ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Online_users_total'] ) );
}
// End replacement - Topic in Who is online MOD
#
#-----[ OPEN ]------------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------------
#
function session_pagestart($user_ip, $thispage_id)
#
#-----[ IN-LINE FIND ]----------------------------------------
#
)
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
, $thistopic_id=PAGE_INDEX
#
#-----[ FIND ]------------------------------------------------
#
if ( $current_time - $userdata['session_time'] > 60 )
#
#-----[ IN-LINE FIND ]----------------------------------------
#
)
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
|| ((( $userdata['user_id'] == ANONYMOUS )?$userdata['user_session_topic']:$userdata['session_topic']) != $thispage_topic) || (( $userdata['user_id'] == ANONYMOUS )?$userdata['user_session_page']:$userdata['session_page']) != $thispage_id
#
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . SESSIONS_TABLE . "
SET
WHERE
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$thispage_id
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, session_topic = '".$thistopic_id ."'
#
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET
WHERE
#
#-----[ IN-LINE FIND ]----------------------------------------
#
$thispage_id
#
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
, user_session_topic='" . $thistopic_id . "'
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]-----------------------------------------
#
// Start add - Topic in Who is online MOD
$lang['Browsing_topic'] = 'Users browsing this topic:';
// End add - Topic in Who is online MOD
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
{LOGGED_IN_USER_LIST}</b></span></td>
#
#-----[ IN-LINE FIND ]----------------------------------------
#
{LOGGED_IN_USER_LIST}
#
#-----[ IN-LINE BEFORE, ADD ]---------------------------------
#
{TOTAL_USERS_ONLINE}<br/>
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
<tr>
<td align="left" valign="bottom" colspan="2"><a class="maintitle" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><br />
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- Start add - Topic in Who is online MOD -->
<span class="gensmall"><b><br/>{TOTAL_USERS_ONLINE}<br/>{LOGGED_IN_USER_LIST}</b></span></td>
<!-- End add - Topic in Who is online MOD -->
#
#-----[ FIND ]------------------------------------------------
#
<span class="gensmall"><b>{PAGINATION}</b><br />
</span></td>
</tr>
#
#-----[ REPLACE WITH ]----------------------------------------
#
<!-- Start replacement - Topic in Who is online MOD -->
<td align="right" valign="bottom" nowrap="nowrap"><span class="gensmall"><b>{PAGINATION}</b></span></td>
</tr>
<!-- End replacement - Topic in Who is online MOD -->
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM
Только вот:
как изменить эту точку отсчёта, когда он запускает эти 24 часа.За последние 24 часа, здесь было 1 пользователей:
А то у меня где-то в 15:00 обнуляет, не удобно.