Is there a simple way to get:
- Total number of users
- Total number of files
- Total storage
?
I'm looking to display them on the home page so they should be in a TMPL_VAR.
XFileSharing Pro - Simple way to get the total number of users/files and total storage stats?
Re: Simple way to get the total number of users/files and total storage stats?
Go to your site setting, and checked to enable :
Show server stats on main page
Show server stats on main page
Re: Simple way to get the total number of users/files and total storage stats?
I actually have it enabled but I cannot find the variables for it. It's supposed to be either in main.html or splash.html if I'm understanding well, but there is nothing referring to stats.verzing wrote:Go to your site setting, and checked to enable :
Show server stats on main page
Re: Simple way to get the total number of users/files and total storage stats?
Those code in upload_formDundil wrote:I actually have it enabled but I cannot find the variables for it. It's supposed to be either in main.html or splash.html if I'm understanding well, but there is nothing referring to stats.verzing wrote:Go to your site setting, and checked to enable :
Show server stats on main page
Re: Simple way to get the total number of users/files and total storage stats?
Found it thank you!verzing wrote:Those code in upload_formDundil wrote:I actually have it enabled but I cannot find the variables for it. It's supposed to be either in main.html or splash.html if I'm understanding well, but there is nothing referring to stats.verzing wrote:Go to your site setting, and checked to enable :
Show server stats on main page
In case someone needs the same tip, the variables are:
Code: Select all
<TMPL_VAR user_total>
<TMPL_VAR used_total>
<TMPL_VAR files_total>
Code: Select all
sub main
{
my $stats;
$stats =
$db->SelectRow("SELECT SUM(srv_files) as files_total, ROUND(SUM(srv_disk)/1073741824,2) as used_total FROM Servers");
$stats->{user_total} = $db->SelectOne("SELECT COUNT(*) FROM Users");
$ses->PrintTemplate('splash.html',
'user_total' => $stats->{user_total},
'files_total' => $stats->{files_total},
'used_total' => $stats->{used_total},
demo_mode => $c->{demo_mode});
}