Previous Thread
Next Thread
Print Thread
Rate Thread
#54538 09/01/2002 5:55 PM
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
Joined: Jun 2001
Posts: 2,849
How about a way to dump a list containing 5 columns;

1. Member #

2. login names

3. public names

4. last post IP

5. registration IP

It would be really helpful to be able to access this data. Any ideas?

Sponsored Links
#54539 09/01/2002 9:12 PM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
Idle, has an advanced IP recording modification that really is great. Does not break it down as you are looking but does list all the IPs the user has come in under.

#54540 09/01/2002 9:41 PM
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
Joined: Jun 2001
Posts: 2,849
I have that installed thanks, I'm looking for something that will dump all users into a flat file with those columns. I would like to import it into a spreadsheet or a database and make it searchable outside of the UBB.

#54541 09/02/2002 8:32 AM
Joined: Nov 2001
Posts: 12
Junior Member
Junior Member
Offline
Joined: Nov 2001
Posts: 12
I have a script that I think will do what you want. Minor difference is that it also scans all the posts to get ANY ip they've EVER posted from. It also only adds an ip if its not a duplicate of one already extracted.

You can remove the routine to scan the posts if you like (as well as the check for duplicates).

Here it is, just change $path to run it and see what you get. You might also have to bump @ips up if you have more than 1000 members (to avoid an "uninitialized value" message).

Hope this helps.

Code
#!/usr/bin/perl -w
use strict;
use LWP::Simple qw(get);
my $path="/xxx/xxx/xxxxxx";
####################
# extract ips by member
####################
my $DATE=localtime(time);
my $ip="";
my $posts="";
my @posts="";
my $filename="";
my $line="";
my @bpost="";
my $bpost="";
my $memnum=0;
my $mcnt=0;
my @ips=("") x 1000;
my $ips="";
my @ln="";
my $ln="";
my @pdn="";
my $pdn="";
my $ipctr=1;
my $test="";
my $ctr=0;
###################################
# print the document header stuff #
###################################
#################################################################
# main routine, loop thru each member record #
#################################################################
open(J,">$path/cgi-bin/iplist.txt");
# get member records
opendir (POSTLIST, "$path/cgi-bin/Members") || die "Cannot open member records";
@posts=grep (/cgi/, readdir POSTLIST);
# process each
foreach $filename (@posts) {
if(substr($filename,0,1) eq "0") {
open(P,"$path/cgi-bin/Members/$filename");
$ctr=0;
$memnum=$filename;
$test=index(".",$filename);
$memnum=substr($memnum,0,$test-3);
while(defined($line=

)) {
$ctr++;
chomp($line);
if($ctr==1) {$ln[$memnum]=$line;}
if($ctr==16) {$pdn[$memnum]=$line;}
if($ctr==34){
$ip=$line;
if(index($ips[$memnum],$ip) < 0){$ips[$memnum]=$ips[$memnum]." $ip";}
} # end of ctr=34
if($ctr==24){
$ip=$line;
$test=index("|",$line);
if($test>0){
$ip=substr($ip,$test+1);
if(index($ips[$memnum],$ip) < 0){$ips[$memnum]=$ips[$memnum]." $ip";}
} # end of $test
} # end of ctr=24
} # end of member file
close(P);
} # end of look for 0 in filename
} # end of $filenames
closedir(POSTLIST);

# get files
@posts="";
opendir(POSTLIST, "$path/cgi-bin/Members/user_posts") &#0124;&#0124; die "Cannot open /files/: $!";
@posts=grep (/cgi/, readdir POSTLIST);

# process each file
foreach $filename (@posts) {
open(P,"$path/cgi-bin/Members/user_posts/$filename");

# process each line
while(defined($line=

)) {
chomp($line);
@bpost=split(/|/,$line);
$memnum=$filename;
$test=index(".",$filename);
$memnum=substr($memnum,0,$test-3);
#print "$memnumn";
$ip=$bpost[4];
if(index($ips[$memnum],$ip) < 0) {$ips[$memnum]=$ips[$memnum]." $ip";}
} # end of each file

close(P);
} # end of $filenames
closedir(POSTLIST);
while($ipctr<=$#ips) {
if($ips[$ipctr]) {print J substr("00000000".$ipctr,length("00000000".$ipctr)-8)." $ln[$ipctr] $pdn[$ipctr] $ips[$ipctr]n";}
$ipctr++;
} #end of array
close(J);

#54542 04/30/2003 9:24 PM
Joined: Feb 2000
Posts: 33
mb Offline
Member
Member
Offline
Joined: Feb 2000
Posts: 33
Bill,
I want to be able to dump all the member fields that I have out to the flat file. Is there a quick way to articulate how to modify the script to get everything?

Thanks!
Marianne

Sponsored Links
#54543 05/08/2003 7:59 AM
Joined: Nov 2001
Posts: 12
Junior Member
Junior Member
Offline
Joined: Nov 2001
Posts: 12
Sorry I took so long to respond, but yes, I've emailed you a script to output all the fields.

Let me know if you have any questions laugh


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)