[Cpan-forum-commit] rev 275 - in trunk: . lib/CPAN/Forum lib/CPAN/Forum/RM templates
svn at pti.co.il
svn at pti.co.il
Fri Jul 20 17:45:54 EEST 2007
Author: gabor
Date: 2007-07-20 17:45:54 +0300 (Fri, 20 Jul 2007)
New Revision: 275
Modified:
trunk/
trunk/lib/CPAN/Forum/DBI.pm
trunk/lib/CPAN/Forum/RM/Other.pm
trunk/templates/about.tmpl
Log:
add number of tags to the about page
use plqin SQL to build the stats on the about page
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 7bc34947-122d-0410-bc5a-f898d2bb5f81:/local/cpan-forum:4260
8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:12752
+ 7bc34947-122d-0410-bc5a-f898d2bb5f81:/local/cpan-forum:4261
8c4c90e1-83eb-0310-96eb-e7cb62807872:/local/cpan-forum:12752
Modified: trunk/lib/CPAN/Forum/DBI.pm
===================================================================
--- trunk/lib/CPAN/Forum/DBI.pm 2007-07-20 14:45:38 UTC (rev 274)
+++ trunk/lib/CPAN/Forum/DBI.pm 2007-07-20 14:45:54 UTC (rev 275)
@@ -93,5 +93,10 @@
return $dbh->selectall_arrayref($sql, \%args);
}
+sub count_rows_in {
+ my ($self, $table) = @_;
+ return $self->_fetch_single_value("SELECT COUNT(*) FROM $table");
+}
+
1;
Modified: trunk/lib/CPAN/Forum/RM/Other.pm
===================================================================
--- trunk/lib/CPAN/Forum/RM/Other.pm 2007-07-20 14:45:38 UTC (rev 274)
+++ trunk/lib/CPAN/Forum/RM/Other.pm 2007-07-20 14:45:54 UTC (rev 275)
@@ -13,10 +13,11 @@
my $self = shift;
my $t = $self->load_tmpl("about.tmpl");
- $t->param(distro_cnt => CPAN::Forum::DB::Groups->count_all());
- $t->param(posts_cnt => CPAN::Forum::DB::Posts->count_all());
- $t->param(users_cnt => CPAN::Forum::DB::Users->count_all());
- $t->param(subscription_cnt => CPAN::Forum::DB::Subscriptions->count_all());
+ $t->param(distro_cnt => CPAN::Forum::DBI->count_rows_in('groups'));
+ $t->param(posts_cnt => CPAN::Forum::DBI->count_rows_in('posts'));
+ $t->param(users_cnt => CPAN::Forum::DBI->count_rows_in('users'));
+ $t->param(subscription_cnt => CPAN::Forum::DBI->count_rows_in('subscriptions'));
+ $t->param(tag_cloud_cnt => CPAN::Forum::DBI->count_rows_in('tag_cloud'));
$t->param(version => $self->version);
# number of posts per group name, can create some xml feed from it that can
# be used by search.cpan.org and Kobes to add a number of posts next to the link
Modified: trunk/templates/about.tmpl
===================================================================
--- trunk/templates/about.tmpl 2007-07-20 14:45:38 UTC (rev 274)
+++ trunk/templates/about.tmpl 2007-07-20 14:45:54 UTC (rev 275)
@@ -49,6 +49,7 @@
<li>Number of posts: <TMPL_VAR posts_cnt></li>
<li>Number of people: <TMPL_VAR users_cnt></li>
<li>Number of subscriptions: <TMPL_VAR subscription_cnt></li>
+ <li>Number of tags in cloud: <TMPL_VAR tag_cloud_cnt></li>
</ul>
<p class="about_p">
If you have technical problems please contact
More information about the Cpan-forum-commit
mailing list