Skip to content

Commit

Permalink
Add $Id tags, site_info description and requiresplugin; take out some
Browse files Browse the repository at this point in the history
debug prints and improve others.
  • Loading branch information
jamiemccarthy committed May 30, 2006
1 parent a323a67 commit 07b4414
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions tagboxes/TagCountUser/Makefile.PL
@@ -1,6 +1,7 @@
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
# $Id$
WriteMakefile(
'NAME' => 'Slash::Tagbox::TagCountUser',
'VERSION_FROM' => 'TagCountUser.pm', # finds $VERSION
Expand Down
3 changes: 3 additions & 0 deletions tagboxes/TagCountUser/TAGBOX
@@ -1 +1,4 @@
# $Id$
name=TagCountUser
description=Count active tags for each user
mysql_dump=mysql_dump.sql
10 changes: 4 additions & 6 deletions tagboxes/TagCountUser/TagCountUser.pm
Expand Up @@ -47,10 +47,8 @@ sub new {
# Note that getTagboxes() would call back to this new() function
# if the tagbox objects have not yet been created -- but the
# no_objects option prevents that. See getTagboxes() for details.
#print STDERR "TCU::new calling getTagboxes $tagbox_name\n";
my %self_hash = %{ getObject('Slash::Tagbox')->getTagboxes($tagbox_name, undef, { no_objects => 1 }) };
my $self = \%self_hash;
#print STDERR "TCU::new called getTagboxes $tagbox_name, self: " . Dumper($self);
return undef if !$self || !keys %$self;

bless($self, $class);
Expand All @@ -62,7 +60,7 @@ sub new {

sub feed_newtags {
my($self, $tags_ar) = @_;
print STDERR "Slash::Tagbox::TagCountUser->feed_newtags called: tags_ar='@$tags_ar'\n";
print STDERR "Slash::Tagbox::TagCountUser->feed_newtags called: tags_ar='" . join(' ', map { $_->{tagid} } @$tags_ar) . "'\n";
my $ret_ar = [ ];
for my $tag_hr (@$tags_ar) {
push @$ret_ar, {
Expand All @@ -76,21 +74,21 @@ print STDERR "Slash::Tagbox::TagCountUser->feed_newtags called: tags_ar='@$tags_

sub feed_deactivatedtags {
my($self, $tags_ar) = @_;
print STDERR "Slash::Tagbox::TagCountUser->feed_deactivatedtags called: tags_ar='@$tags_ar'\n";
print STDERR "Slash::Tagbox::TagCountUser->feed_deactivatedtags called: tags_ar='" . join(' ', map { $_->{tagid} } @$tags_ar) . "'\n";
return $self->feed_newtags($tags_ar);
}

sub feed_userchanges {
my($self, $users_ar) = @_;
print STDERR "Slash::Tagbox::TagCountUser->feed_userchanges called: users_ar='@$users_ar'\n";
print STDERR "Slash::Tagbox::TagCountUser->feed_userchanges called: users_ar='" . join(' ', map { $_->{tuid} } @$users_ar) . "'\n";
return [ ];
}

sub run {
my($self, $affected_id) = @_;
my $tagboxdb = getObject('Slash::Tagbox');
my $user_tags_ar = $tagboxdb->getTagboxTags($self->{tbid}, $affected_id, 0);
print STDERR "Slash::Tagbox::TagCountUser->run called for $affected_id, ar count $#$user_tags_ar\n";
print STDERR "Slash::Tagbox::TagCountUser->run called for $affected_id, ar count " . scalar(@$user_tags_ar) . "\n";
my $count = grep { !defined $_->{inactivated} } @$user_tags_ar;
$self->setUser($affected_id, { tag_count => $count });
}
Expand Down
1 change: 1 addition & 0 deletions tagboxes/TagCountUser/mysql_dump.sql
@@ -1,2 +1,3 @@
# $Id$
INSERT INTO tagboxes (tbid, name, affected_type, weight, last_run_completed, last_tagid_logged, last_tdid_logged, last_tuid_logged) VALUES (NULL, 'TagCountUser', 'user', 1, '2000-01-01 00:00:00', 0, 0, 0);
#INSERT INTO tagbox_userkeyregexes VALUES ('TagCountUser', '^tag_clout$');

0 comments on commit 07b4414

Please sign in to comment.