Here's a bizare suggestion.
Yesterday, I worked out a global that would keep track of a user's link when they logged in. This modification may work, but you probably would want to change it to a bogus username after running it once.
The working global is here:
http://www.gossamer-threads.com/...orum.cgi?post=240773 The modified version is below. You need to install it as in the working version, and if you know your way around the admin, it would take about 2 minutes. Once installed, and you log in with your admin ID, you should have values in the two columns "User_Links_Validated" and "User_Links_Unvalidated". If you do, and you are comfortable the update worked, you can then just
Delete from prefix_Users where (User_Links_Validated = 0 and User_Links_Unvalidated = 0 )
(Always make the "Delete From" a "Select * from" to make sure it works, then change it)
NOTE: Don't use this if you have 1000's of users. Although Links may have built in limiting code. If so, after running this once, _some_ fields will have updated fields with values. You'll have to change the select Users code to exclude selecting users with validated or unvalidated links, and keep logging in <G> It's not elegant, but it _should_ work.
Code:
sub {
## if you add two columns to your Users table, Link_Count_Validated and Link_Count_Unvalidated
## every time a user logs on, their counts will be updated in their user record.
## low overhead call, as long as you only call it on the Logon Success page.
## or, add a test, and another parameter to flag the updates.
##
## my $update_USER_counts = shift;
##
## and wrap the db_user->update call in an 'if $update_USER_counts call.
## pass in <%get_user_link_count (1)%> to flag the update, 0 to ignore.
##
my $update = shift;
($USER) || return (user_link_count => 0, user_link_count_un => 0, user_link_count_val => 0);
my $db = $DB->table('Links');
print "username is: $USER->{Username}";
my $user_link_count_val = $db->count(isValidated => 'Yes', LinkOwner => $USER->{Username});
my $user_link_count_un = $db->count(isValidated => 'No', LinkOwner => $USER->{Username});
my $user_link_count = $user_link_count_val + $user_link_count_un ;
if ($USER->{'Username'} eq 'Your_Admin_ID') {
my $user_db = $DB->table('Users');
my $sth = $user_db->select ( { }, [Username]); ## I'm not sure about this line
while (my $cat = $sth->fetchrow_hashref) {
my $user_name = $cat->{Username};
my $user_link_count_val = $db->count(isValidated => 'Yes', LinkOwner => $cat->{Username});
my $user_link_count_un = $db->count(isValidated => 'No', LinkOwner => $cat->{Username});
my $user_link_count = $user_link_count_val + $user_link_count_un ;
$db_user->update (
{
Link_Count_Validated => $user_link_count_val,
Link_Count_Unvalidated => $user_link_count_un
},
{
Username => $cat->{'Username'}
}
);
}
} elsif ($update) {
my $db_user = $DB->table('Users');
$db_user->update (
{
Link_Count_Validated => $user_link_count_val,
Link_Count_Unvalidated => $user_link_count_un
},
{
Username => $USER->{'Username'}
});
};
return ( {
user_link_count => $user_link_count,
user_link_count_un => $user_link_count_un,
user_link_count_val => $user_link_count_val
})
}
PUGDOG� Enterprises, Inc. The best way to contact me is to
NOT use Email.
Please leave a PM here.