[Release] NV Who was here? Add-On
Posted: Sun 20. Jun 2010, 11:11
by Marc
Add-On: NV Who was here?
Add-On Version: 1.0.0
Add-On Description:
Addon for phpBB Statistics that will display statistics about NV Who was here? by nickvergessen:
Add-On Author: Marc Alexander
phpBB Version: 3.0.7-PL1
phpBB Styles: prosilver
Languages: English, German
Anleitung / Instructions:
Add-On Version: 1.0.0
Add-On Description:
Addon for phpBB Statistics that will display statistics about NV Who was here? by nickvergessen:
- Total visited users
- Total visited Registered Users
- Total visited Guests
- Total visited Bots
- Total visited Hidden Users
- Total visits
- Number of visited Users (per defined timeframe)
- Number of visited Registered Users (per defined timeframe)
- Number of visited Guests (per defined timeframe)
- Number of visited Bots (per defined timeframe)
- Number of visited Hidden Users (per defined timeframe)
- Visits by day time
- Top 10 users (by visits)
Add-On Author: Marc Alexander
phpBB Version: 3.0.7-PL1
phpBB Styles: prosilver
Languages: English, German
Anleitung / Instructions:
- [+] Anleitung - DE
- Lade das Archiv herunter und extrahiere es. Lade alle Dateien und Ordner innerhalb des root Verzeichnisses in dein Foren Hauptverzeichnis hoch.
Öffne includes/functions_wwh.php
Finde:Danach einfügen:Code: Select all
function update_who_was_here_session () { global $phpbb_root_path, $db, $user; if ($user->data['user_id'] != ANONYMOUS) {
Finde:Code: Select all
/* * phpBB Statistics - NV Who was here? Add-On * by Marc Alexander (c) 2010 */ global $table_prefix; if (!defined('STATS_WWH_TABLE')) { define('STATS_WWH_TABLE', $table_prefix . 'stats_wwh'); } $db->sql_return_on_error(true); // I don't care if it's a duplicate and the user doesn't care $sql = 'INSERT INTO ' . STATS_WWH_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'name' => (int) time(), 'data' => (int) $user->data['user_id'])); $db->sql_query($sql); $db->sql_return_on_error(false); // NV Who was here? Add-On -- END --
Danach einfügen:Code: Select all
else { $timestamp_cleaning = $timestamp - ((3600 * $config['wwh_del_time_h']) + (60 * $config['wwh_del_time_m']) + $config['wwh_del_time_s']); } if ((!isset($config['wwh_last_clean']) || ($config['wwh_last_clean'] != $timestamp_cleaning)) || !$config['wwh_version']) {
Code: Select all
/* * phpBB Statistics - NV Who was here? Add-On * by Marc Alexander (c) 2010 */ global $table_prefix; define('STATS_WWH_TABLE', $table_prefix . 'stats_wwh'); $sql = 'SELECT name, data FROM ' . STATS_WWH_TABLE . " WHERE name = 'last_purge'"; $result = $db->sql_query($sql); $last_purge = $db->sql_fetchfield('data'); if($config['wwh_version'] || ($last_purge <= $timestamp_cleaning)) { $wwh_count_total = $wwh_count_reg = $wwh_count_guests = $wwh_count_bot = $wwh_count_hidden = 0; $user_id_ary = array(); $sql = 'SELECT user_id, user_type, viewonline FROM ' . WWH_TABLE . " ORDER BY user_id ASC"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { if (!in_array($row['user_id'], $user_id_ary)) { // At the end let's count them =) if ($row['user_id'] == ANONYMOUS) { ++$wwh_count_guests; } else if ($row['user_type'] == USER_IGNORE) { ++$wwh_count_bot; } else if ($row['viewonline'] == 1) { ++$wwh_count_reg; } else { ++$wwh_count_hidden; } ++$wwh_count_total; } } $db->sql_freeresult($result); $insert_var = $wwh_count_total . ',' . $wwh_count_reg . ',' . $wwh_count_guests . ',' . $wwh_count_bot . ',' . $wwh_count_hidden; $sql = 'INSERT INTO ' . STATS_WWH_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'name' => (int) time(), 'data' => $db->sql_escape($insert_var))); $db->sql_query($sql); $sql = 'UPDATE ' . STATS_WWH_TABLE . ' SET data = ' . time() . " WHERE name = 'last_purge'"; $result = $db->sql_query($sql); if(!$db->sql_affectedrows($result)) { $sql = 'INSERT INTO ' . STATS_WWH_TABLE . " (name, data) VALUES('last_purge', '" . time() . "');"; $db->sql_query($sql); } $db->sql_freeresult($sql); } // NV Who was here? Add-On -- END --
Danach folge einfach dem folgenden How To:
http://www.m-a-styles.de/viewtopic.php? ... p=569#p569
- [+] Instructions - EN
- Download the Archive and extract it. Upload all files and folders inside the root folder to your forum root.
Open includes/functions_wwh.php
Find:Add after:Code: Select all
function update_who_was_here_session () { global $phpbb_root_path, $db, $user; if ($user->data['user_id'] != ANONYMOUS) {
Find:Code: Select all
/* * phpBB Statistics - NV Who was here? Add-On * by Marc Alexander (c) 2010 */ global $table_prefix; if (!defined('STATS_WWH_TABLE')) { define('STATS_WWH_TABLE', $table_prefix . 'stats_wwh'); } $db->sql_return_on_error(true); // I don't care if it's a duplicate and the user doesn't care $sql = 'INSERT INTO ' . STATS_WWH_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'name' => (int) time(), 'data' => (int) $user->data['user_id'])); $db->sql_query($sql); $db->sql_return_on_error(false); // NV Who was here? Add-On -- END --
Add after:Code: Select all
else { $timestamp_cleaning = $timestamp - ((3600 * $config['wwh_del_time_h']) + (60 * $config['wwh_del_time_m']) + $config['wwh_del_time_s']); } if ((!isset($config['wwh_last_clean']) || ($config['wwh_last_clean'] != $timestamp_cleaning)) || !$config['wwh_version']) {
After that follow the instructions on how to add an Add-On:Code: Select all
/* * phpBB Statistics - NV Who was here? Add-On * by Marc Alexander (c) 2010 */ global $table_prefix; define('STATS_WWH_TABLE', $table_prefix . 'stats_wwh'); $sql = 'SELECT name, data FROM ' . STATS_WWH_TABLE . " WHERE name = 'last_purge'"; $result = $db->sql_query($sql); $last_purge = $db->sql_fetchfield('data'); if($config['wwh_version'] || ($last_purge <= $timestamp_cleaning)) { $wwh_count_total = $wwh_count_reg = $wwh_count_guests = $wwh_count_bot = $wwh_count_hidden = 0; $user_id_ary = array(); $sql = 'SELECT user_id, user_type, viewonline FROM ' . WWH_TABLE . " ORDER BY user_id ASC"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { if (!in_array($row['user_id'], $user_id_ary)) { // At the end let's count them =) if ($row['user_id'] == ANONYMOUS) { ++$wwh_count_guests; } else if ($row['user_type'] == USER_IGNORE) { ++$wwh_count_bot; } else if ($row['viewonline'] == 1) { ++$wwh_count_reg; } else { ++$wwh_count_hidden; } ++$wwh_count_total; } } $db->sql_freeresult($result); $insert_var = $wwh_count_total . ',' . $wwh_count_reg . ',' . $wwh_count_guests . ',' . $wwh_count_bot . ',' . $wwh_count_hidden; $sql = 'INSERT INTO ' . STATS_WWH_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'name' => (int) time(), 'data' => $db->sql_escape($insert_var))); $db->sql_query($sql); $sql = 'UPDATE ' . STATS_WWH_TABLE . ' SET data = ' . time() . " WHERE name = 'last_purge'"; $result = $db->sql_query($sql); if(!$db->sql_affectedrows($result)) { $sql = 'INSERT INTO ' . STATS_WWH_TABLE . " (name, data) VALUES('last_purge', '" . time() . "');"; $db->sql_query($sql); } $db->sql_freeresult($sql); } // NV Who was here? Add-On -- END --
http://www.m-a-styles.de/viewtopic.php? ... p=572#p572
- nv_wwh_addon_1.0.0.zip
- (9.62 KiB) Downloaded 2464 times