UBB.Dev
Posted By: havoq [6.3.x] [beta] Recent Visitors Stats - 08/28/2004 7:10 PM
Modification Name: *Recent Visitors Stats

Author: havoq

Description: Displays PNTF stats in summary category

Demo: Demo

Download Link: Download

Note: This works in conjunction with Ians Hidden User Hack located here If this isnt installed then you will not get the hidden users stats. Also this version isn't worditezed. That can be done as well if one so inclined

2nd Note: This hack probably will work on 6.7 if the code is equivalent. In fact I encourage anyone to port it over. I just didn't wanna post it in there and have the code be possibly wrong. However, consider this a 6.7 hack really... tipsy
Posted By: AllenAyres Re: [6.3.x] [beta] Recent Visitors Stats - 08/28/2004 7:23 PM
Nice one Jon thumbsup
Posted By: eXtremeTim Re: [6.3.x] [beta] Recent Visitors Stats - 10/26/2004 3:05 AM
Installed good job.
Posted By: Felix 10 Re: [6.3.x] [beta] Recent Visitors Stats - 10/31/2004 3:56 AM
Jon,

you mentioned you need Ian's Mod ( for 6.7x) but
how did you addressed this:

Code
 In ubb_lib_pntf.cgi

FIND:

&& ($main::vars_pntf{AllowHidden} eq "no")
) {
$users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]} = $uniqs{$uniq};


ADD AFTER:

} elsif (
($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0] =~ m/^d{8}$/)
&& (
($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[2] == 1)
&& ($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[1] == 0)
)
&& (!exists $users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]})
&& ($main::vars_pntf{AllowHidden} ne "no")
) {
$results->{"hidden"}++;
6.3.1 has something like this instead:

Code
 FOR 6.3.1       # Set the UNIQ's pref data properly
$self->{DATA}->{uniq}->{logins}->{$uniq} = [$user_number, $nologin, $hidden, $daysprune];
Thank you,

Felix
Posted By: Felix 10 Re: [6.3.x] [beta] Recent Visitors Stats - 10/31/2004 4:39 AM
ops, sorry double post.

LK, please delete.

smile
Posted By: havoq Re: [6.3.x] [beta] Recent Visitors Stats - 10/31/2004 5:58 PM
I dont think I ever said to modify that file
Posted By: Ian Spence Re: [6.3.x] [beta] Recent Visitors Stats - 10/31/2004 8:00 PM
He was refering to my mod. I don't have a copy of 6.3, so I won't be able to help. Hopefully someone will be able to though
Posted By: havoq Re: [6.3.x] [beta] Recent Visitors Stats - 10/31/2004 10:55 PM
no, I think you have the wrong line of code there felix. I looked up that code in my file and its unchanged. What you need to find is this.

Find: ubb_lib_pntf.cgi
Code
	# Okay, figure out guests
foreach my $uniq (keys %uniqs) {
Replace With:
Code
	# Okay, figure out guests
foreach my $uniq (keys %uniqs) {

if (($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0] =~ m/^d{8}$/) && (($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[2] == 0) && ($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[1] == 0)) && (!exists $users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]})) {
$users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]} = $uniqs{$uniq};

} elsif (
($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0] =~ m/^d{8}$/)
&& (
($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[2] == 1)
&& ($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[1] == 0)
)
&& (!exists $users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]})
&& ($main::vars_pntf{AllowHidden} ne "no")
) {
$results->{"hidden"}++;

} else {
$results->{"guests"}++;
}
} # end foreach
Posted By: Felix 10 Re: [6.3.x] [beta] Recent Visitors Stats - 11/01/2004 3:57 AM
hm...not quite, you can't replace that, you will end up with the same routine twice, but I got it.
Here, this is the whole Ian's Invisible Mod for 6.3x. Just in case someone else running absolete versions, like us, would need it:

Code
 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x In public_pntf_summary.pl x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

FIND:


if($r->{"overflow"} > 0) {
if($userstring[0] =~ m/d{8}/) {
push(@userstring, qq($r->{"overflow"} $vars_wordlets_pntf{pntf_more_logged_in_users}));
} else {
push(@userstring, qq($r->{"overflow"} $vars_wordlets_pntf{pntf_logged_in_users}));
} # end if
} # end if

ADD AFTER:

if($r->{"hidden"} > 0) {
if($r->{"hidden"} == 1) {
push(@userstring, qq~$r->{'hidden'} $vars_wordlets_pntf{pntf_hidden_one}~);
} else {
push(@userstring, qq~$r->{'hidden'} $vars_wordlets_pntf{pntf_hidden_more}~);
}
}


xxxxxxxxxxxxxxxxxxxxxxxx
x In ubb_lib_pntf.cgi x
xxxxxxxxxxxxxxxxxxxxxxxx

FIND:

$results->{"overflow"} = 0;
$results->{"guests"} = 0;

ADD AFTER:

$results->{"hidden"} = 0;

FIND:


if (($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0] =~ m/^d{8}$/) && (($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[2] == 0) && ($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[1] == 0)) && (!exists $users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]})) {
$users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]} = $uniqs{$uniq};
} else {
$results->{"guests"}++;
}
} # end foreach



REPLACE WITH:

if (($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0] =~ m/^d{8}$/) && (($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[2] == 0) && ($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[1] == 0)) && (!exists $users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]})) {
$users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]} = $uniqs{$uniq};

} elsif (
($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0] =~ m/^d{8}$/)
&& (
($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[2] == 1)
&& ($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[1] == 0)
)
&& (!exists $users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]})
&& ($main::vars_pntf{AllowHidden} ne "no")
) {
$results->{"hidden"}++;

} else {
$results->{"guests"}++;
}
} # end foreach


xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x In vars_wordlets_pntf.cgi x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


FIND:

q!pntf_guests! => q!guest(s)!,

ADD AFTER:

q!pntf_hidden_one! => q!hidden user!,
q!pntf_hidden_more! => q!hidden users!,

#############
# End Hack #
#############
as far as your Mod is concerned, good job smile

I only had to change, in this line:

Code
 <font face="$vars_style{FontFace}"  size="1" color="%%SPANTCOLOR%%"><b>
$title $vars_wordlets_pntf{pntf_simple_title} $r->{'raw_total'}
Code
 size="1" 
with
Code
 size="$vars_style{TextSize}" 
and get rid of
Code
 $title  
.

Thanks Jon
smile

Felix
Posted By: havoq Re: [6.3.x] [beta] Recent Visitors Stats - 11/01/2004 5:18 AM
Yup n/p, now sure how you'd have the same routine twice. Maybe you misunderstood me. Because the same code you posted, is what I have, so maybe I could have explained it better.

In any case....glad you got it workin wink
Posted By: Felix 10 Re: [6.3.x] [beta] Recent Visitors Stats - 11/01/2004 6:14 AM
Read up and you'll understand, if you replace ONLY
Code
 # Okay, figure out guests	foreach my $uniq (keys %uniqs) { 
with the whole thing you will have what is after the
Code
 # Okay, figure out guests	foreach my $uniq (keys %uniqs) { 
twice and will give major headaches. But dont worry about it.

Now, I have multiple templates which I change with the seasons and I added a few more graphics in the CP style templates. they are on the summary page HERE and I dont have to change them every time I change the template. see here: style Summer and Style Blue


Do you want the 'recipe" ?

smile
Posted By: havoq Re: [6.3.x] [beta] Recent Visitors Stats - 11/01/2004 8:56 AM
Felix, I didnt mean add it twice. Why would I use a piece of code twice? I could have said after
Code
# Okay, figure out guests	foreach my $uniq (keys %uniqs) { 
Add this:
Code
if (($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0] =~ m/^d{8}$/) && (($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[2] == 0) && ($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[1] == 0)) && (!exists $users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]})) {
$users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]} = $uniqs{$uniq};

} elsif (
($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0] =~ m/^d{8}$/)
&& (
($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[2] == 1)
&& ($self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[1] == 0)
)
&& (!exists $users{$self->{DATA}->{'uniq'}->{'logins'}->{$uniq}->[0]})
&& ($main::vars_pntf{AllowHidden} ne "no")
) {
$results->{"hidden"}++;

} else {
$results->{"guests"}++;
}
} # end foreach
Because thats what i meant. But its fine.

What do u have the recipe for now? Changing the graphic for the calendar? Because thats the only screenshot I see circled for. I dont see how the timezone graphic you have in the second/third screenshot, reflect the first screenshot
Posted By: Felix 10 Re: [6.3.x] [beta] Recent Visitors Stats - 11/03/2004 4:12 AM
there is more at the bottom, pass by my site, you'll see
smile
© UBB.Developers