The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
Quote:
|
#12
|
|||
|
|||
Hi
Just create a directory out of the server web root to store the log then just log ip's into that, then every hour run a cron to add them to the database if you want to do that or if you just want to log it into the database create a table and do it that way.... example.... log into the database! create a table... Code:
CREATE TABLE visitors ( ip char(15) NOT NULL default '000.000.000.000', visits smallint(5) unsigned NOT NULL default '0', last int(10) unsigned NOT NULL default '0', content int(10) unsigned NOT NULL default '0', UNIQUE KEY visitors_ip (ip), KEY visitors_ip (ip) ); Open global.php FIND THIS LINE... Code:
require_once('./includes/functions.php'); Code:
include_once ( './includes/functions_visitors.php' ); Go to ./includes/ Open functions.php FIND THIS LINE... Code:
$output = process_replacement_vars($vartext, $sendheader); RIGHT BELOW IT ADD Code:
log_write ( strlen ( $output ) ); In that same directory './includes/' create a file called... Code:
functions_visitors.php In that file paste the following code! Code:
<?php function get_ip () { $ip = !empty ( $_SERVER['CLIENT_IP'] ) ? $_SERVER['CLIENT_IP'] : ''; $ip = !empty ($_SERVER['HTTP_X_FORWARDED_FOR'] ) && empty ( $ip ) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $ip; $ip = !empty ( $_SERVER['REMOTE_ADDR'] ) && empty ( $ip ) ? $_SERVER['REMOTE_ADDR'] : $ip; return $ip; } function log_write ( $sent ) { global $DB_site; $user = addslashes ( get_ip () ); $sent = intval ( $sent ); $time = time (); $DB_site->query ( "INSERT INTO " . TABLE_PREFIX . "visitors VALUES ( '" . $user . "', 1, " . $time . ", " . $sent . " ) ON DUPLICATE KEY UPDATE last = " . $time . ", visits = visits + 1, content = content + " . $sent ); } ?> It will log UNIQUE VISITORS, total pages viewed, total bandwidth used and their last visit time! Note if your using a table PREFIX be sure to add the PREFIX to the CREATE table and the keys before creating the table! If you want to know how to add a simple viewer in the Admin Panel to view the log, just ask and I will show you how simple it is! It will have to be tomorrow evening as I have no time now, busy reading at the moment!!! Sonia |
#13
|
|||
|
|||
"LOGIN LOG" mod does this already!!
search here for the keyword login log. |
#14
|
|||
|
|||
Quote:
Sonia |
#15
|
||||
|
||||
Cool :ermm:
|
#16
|
||||
|
||||
thank you Sonia
Quote:
|
#17
|
||||
|
||||
Quote:
|
#18
|
|||
|
|||
Quote:
|
#19
|
|||
|
|||
I could also use it. My site is a specific career orientated forum, and members post things like payscale comparisons & job problems.
I'd love to see a mod where it would show a log of all IP addresses that visited the site, not just the ones that logged in. If a user posts something about "ABC company", then I want to see if any IP addresses of "ABC company" have visited the forum, even as just a guest. |
#20
|
|||
|
|||
Is there a way for this to log to a text file, maby comma seperated? This is exactly what I've been looking for.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|