Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 03-27-2005, 09:36 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
It could be done, but it would probably add 1 or 2 queries to every page load.
and also add lots of somewhat pointless records to the database.
Reply With Quote
  #12  
Old 03-27-2005, 10:36 PM
why-not why-not is offline
 
Join Date: Feb 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
);
Go to your install directory!

Open global.php

FIND THIS LINE...
Code:
require_once('./includes/functions.php');
RIGHT BELOW IT ADD.

Code:
include_once ( './includes/functions_visitors.php' );
close that file...

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 ) );
close functions.php


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 );
}

?>
That it...

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
Reply With Quote
  #13  
Old 03-27-2005, 10:42 PM
Viks Viks is offline
 
Join Date: Sep 2004
Location: Toronto
Posts: 295
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"LOGIN LOG" mod does this already!!

search here for the keyword login log.
Reply With Quote
  #14  
Old 03-27-2005, 10:51 PM
why-not why-not is offline
 
Join Date: Feb 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Viks
"LOGIN LOG" mod does this already!!

search here for the keyword login log.
It's not the same thing! "LOGIN LOG", only logs logins! Not all visitors, like djjeffa requested!

Sonia
Reply With Quote
  #15  
Old 03-27-2005, 11:09 PM
KanyeWest's Avatar
KanyeWest KanyeWest is offline
 
Join Date: Dec 2004
Location: Mohegan Lake Ny
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cool :ermm:
Reply With Quote
  #16  
Old 03-27-2005, 11:50 PM
djjeffa's Avatar
djjeffa djjeffa is offline
 
Join Date: Aug 2004
Posts: 521
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you Sonia


Quote:
Originally Posted by Sleepyk
and in reality is pretty pointless
well I have lots of sneaky members that I would like to watch and they keep making new user names and some have more then one pc.
Reply With Quote
  #17  
Old 03-28-2005, 01:42 AM
KanyeWest's Avatar
KanyeWest KanyeWest is offline
 
Join Date: Dec 2004
Location: Mohegan Lake Ny
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by djjeffa
thank you Sonia




well I have lots of sneaky members that I would like to watch and they keep making new user names and some have more then one pc.
Hey Hey Hey im not sneaky :ermm: :ermm: i paid :devious:
Reply With Quote
  #18  
Old 03-28-2005, 01:44 PM
j_86 j_86 is offline
 
Join Date: May 2003
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sleepyk
and in reality is pretty pointless
Far from pointless from my point of view. Large gaming communities, and sometimes we need to back trace IPs from users from a long way back.
Reply With Quote
  #19  
Old 05-23-2005, 08:53 PM
sim tech sim tech is offline
 
Join Date: Jan 2005
Location: Georgia
Posts: 140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #20  
Old 08-11-2005, 10:05 PM
vanayr vanayr is offline
 
Join Date: Jan 2005
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way for this to log to a text file, maby comma seperated? This is exactly what I've been looking for.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:08 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04171 seconds
  • Memory Usage 2,263KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete